read RGB values with python

289 views
Skip to first unread message

PEMY

unread,
Aug 5, 2008, 1:01:56 PM8/5/08
to python_inside_maya
Hi all,
I need to read RBG values from a saved images with python.
The image is a tiff file16bit integer (16bit per channel)
The tiff is 1 pixel high and 1024 wide and I need to read all the 1024
colour values.
cheers

Chris G

unread,
Aug 5, 2008, 6:53:58 PM8/5/08
to python_in...@googlegroups.com
Try google, there is PIL which may be overkill and libtiff that I can think of.

Robert Durnin

unread,
Aug 5, 2008, 7:14:01 PM8/5/08
to python_in...@googlegroups.com
I think there is a wrapper for mogrify kicking around as well. It should have some tools for taking pixels by co-ordinate.

r

PEMY

unread,
Aug 7, 2008, 4:55:57 AM8/7/08
to python_inside_maya
Hi PIL is not a solution for me becouse support tiff single channel
16bit.
Currently Ii'm tring to use the OpenEXR module

http://www.excamera.com/articles/26/openexr.html

it should be able to open and read values form a EXR file (16floating
point format per channel)
(it is even better for what I'm doing.)
The problem is that I get a list of errors when I try to install it
under ubuntu.
Anyone is using it?
Cheers


On Aug 6, 12:14 am, "Robert Durnin" <robert.dur...@googlemail.com>
wrote:
> I think there is a wrapper for mogrify kicking around as well. It should
> have some tools for taking pixels by co-ordinate.
>
> r
>
> On Tue, Aug 5, 2008 at 3:53 PM, Chris G <cgreb...@gmail.com> wrote:
> > Try google, there is PIL which may be overkill and libtiff that I can think
> > of.
>

Chris G

unread,
Aug 7, 2008, 9:23:03 PM8/7/08
to python_in...@googlegroups.com
What about the MImage class?  Does it support tiff?

Dean Edmonds

unread,
Aug 8, 2008, 3:34:52 AM8/8/08
to python_in...@googlegroups.com
On Thu, Aug 7, 2008 at 6:23 PM, Chris G <cgre...@gmail.com> wrote:
> What about the MImage class? Does it support tiff?

It does.

--
-deane

Als

unread,
Aug 7, 2008, 7:26:25 PM8/7/08
to python_inside_maya
Maybe quick solution might be to convert your tif files to ppm, and
then read them:
http://en.wikipedia.org/wiki/Portable_pixmap (there is little python
script).
I hope it helps...

PS
I thought PIL can read 32 bit images.


Als

PEMY

unread,
Aug 8, 2008, 10:50:00 AM8/8/08
to python_inside_maya
Hi thank you for your suggestions.

PIL support the normal RGB 8bit per channel.
I need to read RGB 16bit per channel.

the standard ppm support 8 bit per channel (I will do some test
anyway).

tnks





On Aug 8, 12:26 am, Als <al.s...@yahoo.co.uk> wrote:
> Maybe quick solution might be to convert your tif files to ppm, and
> then read them:http://en.wikipedia.org/wiki/Portable_pixmap(there is little python

kakle

unread,
Sep 21, 2008, 1:36:07 AM9/21/08
to python_inside_maya
i guess its too late but tiff specifications are easilly available, so
u can read a file in binary, if you really must.

partners.adobe.com/public/developer/en/tiff/TIFF6.pdf






Reply all
Reply to author
Forward
0 new messages