[Image-SIG] Help on accessing pixels values
fredrik at pythonware.com
Sat Jun 24 17:14:59 CEST 2006
> First please forgive me for asking such a basic question but I am a newbie
> to Python, to programming and I am alone with my IT worries.
> I would like to access pixels values in order to make some computations but
> with the 1.1.6 PIL, I don't understand.
> As an example, here is what I do:
> import Image
> im = Image.open("myimage.jpg")
> print pixel [0,0] # to see the value of pixel[0,0]
> x=(0,0,0) #black in RGB
> pixel[0,0]=x # to set the first pixel in black
> This gives me an error : "TypeError: unsubscriptable object".
> I believe I am doing something wrong ;(
are you sure you have PIL 1.1.6 ? what does
>>> import Image
More information about the Image-SIG