[gdal-dev] Unusual RGB Tiff files with misleading PhotometricInterpretation: valid or not?
Mikael Rittri
Mikael.Rittri at carmenta.com
Thu Nov 15 11:44:22 PST 2018
Hello, list.
I have recently encountered two unusual Tiff files. According to gdalinfo, there are three bands with the color interpretations
Gray, Undefined and Undefined, but eventually I figured out that they are really Red, Green and Blue. Apparently, GDAL gets
the information from the Tiff tag PhotometricInterpretation, which is "min-is-black" for my files, according to tiffinfo.
One of the files has 8 bits per band and I found no further problems with it.
In the other file, each band contains signed 16-bit integers, but it seems that only the values in the range 0 to 253 are used,
plus the special value -32768 that appears to represent NODATA, although there is not enough metadata to make gdalinfo
understand that -32768 is NODATA. By assuming that the min and max intensities are represented by 0 and 255 in the obvious
way, I could display a sensible image.
My questions are half-technical and half-legal:
1. If an RGB Tiff file doesn't have PhotometricInterpretation = RGB, can it really be claimed that the file adheres to the Tiff standard, or is it corrupt?
When I open the files in QGIS or ArcMap, they assume RGB for the default visualization but I don't know why. One of the files looks great in
ArcMap by default (but slightly too white, I believe), while it looks very much too white by default in QGIS, although the QGIS display can be
fixed by color re-configuration. For the other file, it is QGIS that displays a sensible image by default, whereas ArcMap displays it with very
exaggerated contrast (the default QGIS display is brownish-rusty like Mars while the default ArcMap display is brightly reddish-white like Jupiter).
So the score is 1 - 1 for the ArcMap/QGIS contest... I think the very different default displays confirm that the files are troublesome or corrupt.
2. If the min and max intensities are not the same as the min and max representable numbers for the integer type, then how are
they specified in Tiff? I read something about a TransferRange Tiff tag for this purpose but didn't pursue the details, as I suspect
that my 16-bit Tiff file lacks this information. So let me ask: if the file somehow does contain information about the min and max
intensities, how would that information appear in the output from gdalinfo or tiffinfo?
Kind regards,
Mikael Rittri
Carmenta Geospatial Technologies
http://www.carmenta.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20181115/ef306978/attachment.html>
More information about the gdal-dev
mailing list