For reference, here are all the functions, such as
pixel.setRed(number); to load and manipulate images.
||Set the variable image to hold the "flowers.jpg" image||
||Set the image to print at 5x size on screen. Useful to make changes on very small images such as "x.png" visible.||
||Print the image to the screen.|
||Retrieve the pixel at x,y (0, 0) and store it in a variable named pixel (i.e. the upper left pixel). Changes on that pixel, e.g. ||
||Print the values for one pixel, in the format "r:200 g:12 b:166"|
||Change the pixel's red value to be 255 (we can specify any value 0..255 within the parenthesis). There are analogous functions |
||Retrieve the red value from a pixel (a number in the range 0..255), and store it in a variable named r. There are analogous functions |
||Retrieve the width and height of an image.|
||Scale an image up or down in size so it has the given width and height.|
||Scale an image up or down in size, keeping its proportions, so it is at least as big as the other_image specified. Useful for bluescreen code where we want to make the background at least as big as the foreground. Previously this function was called "setSameSize", so you may see that name used in older code examples (it still works).|
Here's a scratch area to try out code.