Documentation for images.py

image = FileImage(filename)
Return an image object constructed from a particular image file.
image = EmptyImage(width,height)
Return an image object with all black pixels with width columns and height rows.
image.copy()
Return a copy of this image.
image.copyGray()
Return a gray copy of this image.
image.getHeight()
Return the height of this image.
image.getWidth()
Return the width of this image.
image.getNumPixels()
Return the number of pixels in this image.
image.getPixel1D(location)
Return a pixel at the given location, considering the pixels as one long 1 dimensional sequence. The pixel is returned as an rgb color tuple. For example, image.getPixel1D(10) returns (10,200,156).
image.getPixel2D(x,y)
Return a pixel at the given x,y coordinate. The pixel is returned as an rgb color tuple. For example, image.getPixel2D(10,10) returns (10,200,156).
image.setPixel1D(location,color)
Set the color of a pixel at the given location, considering the pixels as one long 1 dimensional sequence. The color must be specified as an rgb color tuple, where the rgb values are between 0 and 255. For example, image.setPixel1D(10,(10,200,156)).
image.setPixel2D(x,y,color)
Set the color of a pixel at the given x,y coordinate. The color must be specified as an rgb color tuple, where the rgb values are between 0 and 255. For example, image.setPixel2D(10,10,(10,200,156)).
image.show(title,x,y)
Display the image with the given window title. x and y are the locations of the window that appears with the image in it.
image.redraw()
Redraw the image. You'll need to do this if you change the image after you show it.