User Tools

Site Tools


blocks:pixels

Pixels

A pixel is an object that contains a reference to the position and color of a single point in the instance's costume (a bitmap). The pixel's color can be reported or set using blocks from this category. The key to working with pixels is the pixels block, which returns a list of pixel objects, one for each pixel in the instance's costume.

It's possible to use the last two blocks in this category to directly get or set the color at a given x-y point in the costume, but for many image manipulation applications it is more convenient to work with a list of pixel objects.

Blocks Description
Set width and height of the instance's costume
Set instances costume to a copy of another image (Note: If you use the set costume block instead of this block you will change that costume everywhere in the project, including in the Images tab.)
Reports a list of all pixels in the instance's costume
Reports a single pixel at a given point in the costume
Report the red component of a pixel (0-255)
Report the green component of a pixel (0-255)
Report the blue component of a pixel (0-255)
Set the red component of color of a pixel
Set the green component of color of a pixel
Set the blue component of color of a pixel
Set the red, green, and blue components of a pixel to the given value
Report the x position of a pixel
Report the y position of a pixel
Report the color of a pixel
Set the color of a pixel
Report a random color
Report the transparent color
Report the width of image
Report the height of image
Report the color of a pixel at the given position
Set the color of a pixel at the given position
blocks/pixels.txt · Last modified: 2017/09/30 09:03 (external edit)