[Image-SIG] Floating-point (color) TIFF

Tom Bridgman bridgman at wyeth.gsfc.nasa.gov
Thu Sep 11 11:05:59 EDT 2003

We also would have some interest in this format as well.

>From my explorations into TiffImagePlugin.py yesterday, I'm wondering
whether the structure is sufficiently modular that just defining some
MODE might 'just work'.

There is also a _MODEINFO entry in Image.py that seems to do fundamental
definitions of things like RGB, RGBA, etc.  For example, for 3,4-channel
FP TIFFs, would a _MODEINFO entry of


(Perhaps others for handling different endian issues?)

and appropriate entries in OPEN_INFO and SAVE_INFO in TiffImagePlugin.py
just call the appropriate modules already in PIL?  Comments are sorely
lacking in some parts of this code so I'm not clear on the precise
calling sequence or overall structure.  "Writing your own file decoder"
in the handbook is some help for a general decoder, but doesn't
enlighten too much on the tiff-specific code.

I don't currently have a floating-point TIFF to test this on.

Just some thinking-out-loud.  Caveat Emptor.


Ragan-Kelley Jonathan wrote:
> I am using Python for the first time on a film effects
> project which is largely built around the color [rgb]
> floating-point TIFFs output from Pixar's RenderMan
> renderer.  I was excited at all of the built-in
> functionality of Python, especially when paired with a
> few additional support libraries like PIL, but my
> first attempts to load the images with PIL yielded
> failure.
> PIL claims support for floating-point TIFFs, but it
> seems to only include single-channel files, not RGB or
> RGBA in FP32.
> I have some old C code specifically built to load
> these relatively uncommon TIFFs, but it seems that PIL
> *should* support them, with at most a minimum of work.
>  Does anyone here have any experience with these
> files, in particular, or any pointers on how to most
> quickly and painlessly add support for them?
> ${python}/lib/site-packages/PIL/TiffImagePlugin.py
> seems to implement all of the basic TIFF IO
> functionality, but it isn't obvious -- superficially
> at least -- where I might quickly add support for
> RGB[A]/FP32.
> Any other recommendations?  I'm not particularly
> wedded to PIL, as I'm primarily using it for image
> loading.  Bringing out my old code and wrapping it
> with SWIG is an easy option, but it would always be
> nice to use existing, commonly-installed
> infrastructure rather than unnecessarily requiring
> custom libraries.
> Thanks.
> -jrk
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig

Dr. William T."Tom" Bridgman           Scientific Visualization Studio
Global Science & Technology, Inc.      NASA/Goddard Space Flight Center
Email: bridgman at wyeth.gsfc.nasa.gov    Code 935
Phone: 301-286-1346                    Greenbelt, MD 20771
FAX:   TBD                             http://svs.gsfc.nasa.gov/

More information about the Image-SIG mailing list