Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which floating-point image format should I use?

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.

like image 371
timday Avatar asked Mar 08 '09 17:03

timday


People also ask

What file format has the best image quality?

RAW files are the highest quality image format. They are loved by photographers as RAW format records all data from the sensor of the camera. Since RAW is an uncompressed format, it gives immense creative liberty to the photographers during post-processing.

Which image format should I use?

The PNG file format is optimized for digital use, making it the most commonly used image format. It also supports more colors than the GIF format – PNG can handle up to 16 million colors, while GIF only supports 256 colors.

Does PNG support floating point?

1.2.The core of PNG does not use floating-point numbers anywhere; it uses integers or, where applicable, fixed-point fractional values. However, special-purpose chunks may need to represent values that do not fit comfortably in fixed-point notation.

Which image format is most recommended for pictures?

JPEG: This is an ideal image format for all types of photographs. PNG: This format is perfect for screenshots and other types of imagery where there's not a lot of color data. GIF: If you want to show off animated graphics on your site, this is the best image format for you.


2 Answers

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.

like image 76
John Ellinwood Avatar answered Sep 20 '22 14:09

John Ellinwood


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 begin a nice and flexible way to store fairly raw data.

like image 28
dmckee --- ex-moderator kitten Avatar answered Sep 19 '22 14:09

dmckee --- ex-moderator kitten