[Image-SIG] question and bug?
Michael A. Miller
07 Dec 2000 11:23:36 -0500
>>>>> "Mike" == Mike Coleman <email@example.com> writes:
> The latter sounds closer to what I'd like to do (the
> function is a messy function from X,Y to X0,Y0), but I
> don't see how to get pixel data in and out of an Image
> (aside from saving it to a file). I've read the doc, but
> maybe I missed it. How can I just manipulate pixel values
> directly, one by one?
Something like this will do it...
w = 256
h = 256
im = Image.new('P',(w,h))
for i in range(w):
for j in range(h):
im.putpixel( (i,j), some_function(i,j) )
Hope that helps, Mike
Michael A. Miller firstname.lastname@example.org
Krannert Institute of Cardiology, IU School of Medicine
Indiana Center for Vascular Biology and Medicine