471,348 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

how to get rgbdata

Hi i am a newbie to python and PIL. can anyone tell me how to get
rgbdata from a jpeg image using PIL
as a double[] . is there an equiv method to java's
BufferedImage.getRGB(0,0,width,height,rgbdata,0,wi dth) ?

if anyone can advise pls do
sj

Oct 9 '07 #1
1 1295
sa*********@gmail.com wrote:
Hi i am a newbie to python and PIL. can anyone tell me how to get
rgbdata from a jpeg image using PIL
as a double[] . is there an equiv method to java's
BufferedImage.getRGB(0,0,width,height,rgbdata,0,wi dth) ?
The docs of PIL are quite good. And there you find the method

Image.getdata()

that does what you want. At least in a way, as it returns a slightly
different format (tuples of ints istead of floats), but I presume you can
convert that by yourself.

http://www.pythonware.com/library/pi...book/image.htm
Diez
Oct 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by pynewbie | last post: by
3 posts views Thread by vbnandu86 | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.