Library support for very high dynamic range TIFF files?
Asked Answered
T

1

7

I work with satellite radar, and have been provided with a (very) large TIFF file containing 32 bpp greyscale data. Unfortunately, libtiff, the standard Linux library for working with TIFF files, doesn't support SampleFormat TIFF files, which means no support for high bit depth greyscale images or floating-point images.

Does anyone know of a FOSS C library which provides support for these types of images? Failing that, can anyone suggest of an appropriate file format to convert to, and a FOSS library that can load that? (Ideally, it should be generally accepted by the scientific community for data interchange, and supported by IDL/ENVI).

Tabard answered 4/2, 2010 at 18:15 Comment(8)
+1. Good first question. Can you give us some idea about the bit-depth and if you've considered alternatives like PNG?Wilma
bit depth: "...TIFF file containing 32 [bits-per-pixel] greyscale data."Integrate
@peter-b: SampleFormat is part TIFF 6.0 which libtiff supports. You will be best served by filing a bug with the libtiff maintainers. I see some similar bugs have been filed before and fixed.Wilma
PNG isn't suitable, unfortunately; it only goes up to 16 bpp greyscale at best. I did mention the bit-depth of 32 bpp in the first line of my question, of course. The problem is that most of the data's histogram is concentrated in about 11 bits, and there would be little visual effect in truncating even to 8 bits (in fact, that's exactly what I do when preparing image cuts for reports), what the algorithm I'm currently working on is concerned with is what goes on at the high, very low probability density end of the distribution -- and truncating/downsampling would lose vital information.Tabard
@dirkgently: Thanks for the suggestion. It's possible I'm basing my question on out-of-date information or an out-of-date package on this box. I didn't notice any mention of SampleFormat support on the libtiff website, but I'll have another look.Tabard
@peter-b: My first question was to inquire if you need bit depths > 32. IIUC, you have 32bpp grayscale (w/o alpha)? JPEG-2000 may be of interest to you. Some open source libraries are available as well.en.wikipedia.org/wiki/JPEG_2000#LibrariesWilma
JPEG is no good -- it's fundamentally a lossy compression algorithm.Tabard
@peter-b: JPEG - 2000 does have lossless compression. And you can take a look at the JBIG2 format.Wilma
S
5

Well libtiff should be able to handle the format, although you may be limited to the low-level apis and doing the conversion to an image yourself. If the size of the images are >4Gb, there is bigtiff, a port of libtiff which handles extremely large images.

Shermy answered 4/2, 2010 at 19:0 Comment(1)
Thanks to you and also to dirkgently: I looked again at the latest version of libtiff and it does appear to be able to do what I need, albeit requiring quite a lot of low-level frobbing of the library to achieve it.Tabard

© 2022 - 2024 — McMap. All rights reserved.