Bearophile
2/16/2008 8:15:00 PM
Gary Herron:
> Try image.getpixel((x,y)) to retrieve the pixel at (x,y).
If the OP needs to access many pixels, then he can use the load()
method on the image object, and then read/write pixels (tuples of 3
ints) using getitem []
import Image
im = Image....
img = im.load()
img[x,y] = ...
.... = img[x,y]
I don't know why the image object itself can't have the __getitem__/
__setitem__
Bye,
bearophile