Try using getdata() on the Image: im = Image.open("oxygen.png") im.load() d = im.getdata() print list(d)
That will give you a list of the form: [(r,g,b,a), (r,g,b,a)... ] Where r=red, g=green, b=blue, and a=alpha. When r==g==b, you have a gray pixel. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alberto Troiano Sent: Tuesday, May 10, 2005 7:09 PM To: [EMAIL PROTECTED] Cc: tutor@python.org Subject: Re: [Tutor] RGB, images Hey Can you be a little more specific on how to get certain part of the image to analyze????? I managed to split it in all its bands (though I don't know what is that) How can I work only with the gray part?????? Thanks Alberto >From: "D. Hartley" <[EMAIL PROTECTED]> >Reply-To: "D. Hartley" <[EMAIL PROTECTED]> >To: Python tutor <tutor@python.org> >Subject: [Tutor] RGB, images >Date: Tue, 10 May 2005 14:08:32 -0700 > > > A shade of gray is made by having r == g == b. > >... so this has nothing to do with masks and transparency? >_______________________________________________ >Tutor maillist - Tutor@python.org >http://mail.python.org/mailman/listinfo/tutor Gaucho _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor