Re: How to get each pixel value from a picture file!

2006-10-25 Thread Tim Roberts
"Lucas" <[EMAIL PROTECTED]> wrote: > >2) I want to put a number into the picture for encryption(replace least >significant bit (LSB) of image intensity with message bit). What formats are your images? Remember that JPEG images are compressed when they are written. It is rather unlikely that your

Re: How to get each pixel value from a picture file!

2006-10-24 Thread Fredrik Lundh
Dennis Lee Bieber wrote: >> 2) i think putpixel((44, 55), (0, 0, 0)) and putpixel((44,55),0) is >> same. > > It shouldn't be... The former is three separate data values, the > latter is one. the "putpixel" API is polymorphic; you can use either tuples or integers for RGB pixels (the latter should

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Fredrik Lundh
Steve Holden wrote: >> 3) pix = im.load() >> print pix[44,55] >> pix[44, 55] = value >> my python cannt identify "[x,y]" ?? >> > > Now what makes you think that an image can be addressed that way? I'd be > quite surprised if yo got anything other than a TypeError

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Gabriel Genellina
At Monday 23/10/2006 21:02, Lucas wrote: http://www.pythonware.com/library/pil/handbook/image.htm im.load() said > > 1)I just copy the tutorial to run "print pix[44,55]". I really dont > > know why they wrote that?! It clearly states that this syntax applies only to version 1.1.6 - and

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Lucas
http://www.pythonware.com/library/pil/handbook/image.htm im.load() said Leif K-Brooks wrote: > Lucas wrote: > > 1)I just copy the tutorial to run "print pix[44,55]". I really dont > > know why they wrote that?! > > What tutorial? Where does it say that? -- http://mail.python.org/mailman/li

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Leif K-Brooks
Lucas wrote: > 1)I just copy the tutorial to run "print pix[44,55]". I really dont > know why they wrote that?! What tutorial? Where does it say that? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Lucas
:) 1)I just copy the tutorial to run "print pix[44,55]". I really dont know why they wrote that?! 2) i think putpixel((44, 55), (0, 0, 0)) and putpixel((44,55),0) is same. thank you again. I think I have solved my problem. Steve Holden wrote: > Lucas wrote: > > Thank you for your answer. > >

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Steve Holden
Lucas wrote: > Thank you for your answer. > > I have some new questions: > > 1) the value of return from getpixel() is a RGB number? > print im.getpixel((44,55)) > (160,160,160) > Yes, that's an RGB tuple. > 2) I want to put a number into the picture for encryption(replace least

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Lucas
Thank you for your answer. I have some new questions: 1) the value of return from getpixel() is a RGB number? print im.getpixel((44,55)) > (160,160,160) 2) I want to put a number into the picture for encryption(replace least significant bit (LSB) of image intensity with message b

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Steve Holden
Lucas wrote: > I want to change some pixel value in the picture file. how to do it? > The most popular way is probably the Python Image Library, known to its friends as PIL: http://www.pythonware.com/products/pil/ You will see from http://www.pythonware.com/library/pil/handbook/image.htm

How to get each pixel value from a picture file!

2006-10-23 Thread Lucas
I want to change some pixel value in the picture file. how to do it? If I read the file in binary mode, a bit == a pixel ? Thanks -- http://mail.python.org/mailman/listinfo/python-list