TIFF Tag Predictor PREDICTOR_FLOATINGPOINT on 32-bit images

I tested the differences in time and file size due to using different TIFF predictor tags.
https://www.awaresystems.be/imaging/tiff/tifftags/predictor.html

The findings are here:
TIFF compression predictor · Issue #4179 · Beep6581/RawTherapee · GitHub

In short, using PREDICTOR_FLOATINGPOINT on 32-bit images takes about as little time as using PREDICTOR_NONE, but produces files up to 20% smaller. It would be good to use it on 32-bit floating-point files. However, I can’t be sure whether the PREDICTOR_FLOATINGPOINT findings are valid, because neither GIMP-2.9.6 nor RawTherapee can open that image, so it could be a bug in saving.

Test images:
https://filebin.net/l19s1pu36p5l2vjr

Fellow devs, have you used it?
Can you open amsterdam_900px_32fp_compressed_predictor-floatingpoint.tif,
and if so, in which program?

PhotoFlow (using VIPS as the image loading backend) cannot load the floating-point predictor version, while it correctly loads the horizontal one.

I’ve been incorporating floating point TIFF into rawproc, as well as generally more robust file open/save, and I get the same results with this -dev version as @Carmelo_DrRaw gets with PhotoFlow.

Edit: Oh, and it’s probably pertinent to supply my TIFF library version: 4.0.6

darktable can’t open it either, it’s just abstract art.

The unlikelihood that several other programs would be unable to open a file using something which has been standard for many years means there’s most likely an issue saving using PREDICTOR_FLOATINGPOINT in RawTherapee’s tiff32float branch. @Hombre hinted yesterday that maybe it requires using ADOBE_DEFLATE compression.

I created that image using probably libtiff-4.0.8, though ldd shows RT linked against /usr/lib64/libtiff.so.5 which points to libtiff.so.5.2.6, so… ???
strings /usr/lib64/libtiff.so.5.2.6 shows LIBTIFF, Version 4.0.8

Doesn’t help that the official website is dead TIFF Documentation
This one is less dead: TIFF Documentation

I clearly identified the bug, which is a mismatch of endianess between Exif tags and image data. So if you try with e.g. a Pentax K-3 which has Intel endianess for exif data should work fine. Now I have to fix it.

1 Like

@Carmelo_DrRaw @ggbutcher @houz could you test these new files if you have a moment?
https://filebin.net/l19s1pu36p5l2vjr

amsterdam-Deflate.tif and amsterdam-LZW.tif both look like this in PhotoFlow:

1 Like

Both work like a charm in darktable.

1 Like

Both open fine in rawproc 0.6.2-dev with floating point TIFF, libtiff-4.0.6

1 Like

So, that was with rawproc 0.6.2, release, dynamically links to the system libtiff-4.0.6 thanks to wxWidgets.:grimacing:

I just compiled another dev version with a static link to libtiff-4.0.8, with all external options disabled, LZW opens but Deflate does not - due to no zlib?