If I open an image with
It's probably best to use the Python Image Library to do this which I'm afraid is a separate download.
The easiest way to do what you want is via the load() method on the Image object which returns a pixel access object which you can manipulate like an array:
from PIL import Image im = Image.open("dead_parrot.jpg") #Can be many different formats. pix = im.load() print im.size #Get the width and hight of the image for iterating over print pix[x,y] #Get the RGBA Value of the a pixel of an image pix[x,y] = value # Set the RGBA Value of the image (tuple)
Alternatively, look at ImageDraw which gives a much richer API for creating images.