[IMAGE-SIG] Editing pixels
Fredrik Lundh
fredrik@pythonware.com
Wed, 23 Jul 1997 17:25:33 +0200
>Does PIL support a single pixel changing operation, or are there just
>expressions to evaluate on an image?
the point method in the ImageDraw class allows you to draw individual
pixels; it doesn't work on RGB images, though (that's fixed in 0.3b1).
0.3b1 will also provide 2D array syntax, including slicing for crop/paste
operations (guess it's high time, now that 1.4 has been available in 9
months...).
> The value of
> a given pixel can be found (img.im[0] etc.), but the color is a three
> tuple which is immutable.
getpixel is the official way to do that; getdata if you wish to access
the whole image as a 1D array.
Cheers /F
_______________
IMAGE-SIG - SIG on Image Processing with Python
send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________