Which floating-point image format should I use?
Asked Answered
C

4

17

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.

Carpal answered 8/3, 2009 at 17:14 Comment(1)
OpenEXR.Tragacanth
L
15

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.

Loyal answered 8/3, 2009 at 17:32 Comment(1)
OpenEXR looks perfect. Excellent Debian support too.Carpal
F
3

For future reference, also rather widespread is the TIFF format. You can use the free and open-source LibTIFF for I/O.

Fidellia answered 17/7, 2017 at 6:49 Comment(0)
M
2

It looks like the modern incarnation of FITS would fit your stated needs, but I would also suggest you consider using a 2D histogram structure from one of the good analysis packages in wide use by the physics community: ROOT or AIDA are the modern ones that I am familiar with.


NB: It's been more than a decade since I used FITS for anything, but I recall it being a nice and flexible way to store fairly raw data.

Mckeever answered 8/3, 2009 at 17:52 Comment(0)
S
1

There is also simple pfm format from netpbm family

Semiliterate answered 22/10, 2023 at 16:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.