Which floating-point image format should I use?

timday picture timday · Mar 8, 2009 · Viewed 9.2k times · Source

In the past I've saved RGB images (generated from physical simulations) as 8-bits/channel PPM or PNG or JPEG.

Now I want to preserve the dynamic range of the simulation output, which means saving a floating point image and then treating conversion to 8-bits/channel as a post-processing step (so I can tweak the conversion to 8-bit without running the lengthy simulation again).

Has a "standard" floating point image format emerged ?

Good free supporting libraries/viewers/manipulation tools, preferably available in Debian, would be a bonus.

Answer

John Ellinwood picture John Ellinwood · Mar 8, 2009

Have you looked into Radiance RGBE (.hdr) and OpenEXR (.exr). RGBE has some source code here. NVIDIA and ATI both support EXR data in their graphics cards. There are source code and binaries from the OpenEXR download page. ILM created OpenEXR and it has wide support. OpenEXR has support for 16 and 32 bit floating point per channel, and is what most people use these days, unless they've written their own format.

  • The Pixel Image Editor for linux has EXR support for editing, too.

  • pfstools is also necessary if you're going to work with HDR on linux. Its a set of command line programs for reading, writing and manipulating HDR and has Qt and OpenGL viewers.

  • Theres also jpeg2exr for linux

  • Heres some other debian packages for OpenEXR viewers.

  • Based on this, it looks like theres also a Gimp plugin somewhere.