4

I checked the official GeoTIFF documentations and there is no reference to color maps. Regardless, I see color maps or tables referenced everywhere, including in other questions.

I am aware that a GeoTIFF can be converted into a RGBA GeoTIFF, but this would simply be a completely different GeoTIFF with the original information lost, unless the legend is also saved separately.

I am asking if there is a way to not change the values of the GeoTIFF and to include in it a threshold based color map (or maybe a rule based one) that can be later interpreted by most software correctly.

Vince
  • 20,017
  • 15
  • 45
  • 64
Andrei
  • 766
  • 5
  • 16
  • GDAL provides the possibility of adding a color table to a GeoTIFF file. Take a look at https://gis.stackexchange.com/a/325751/86131. – Marcelo Villa Aug 09 '20 at 20:29
  • 1
    The GeoTIFF standard only specifies georeferencing http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_scope. Colour table support is software dependent. – user2856 Aug 09 '20 at 21:49
  • @MarceloVilla-Piñeros, just based on the input parameters SetColorEntry only allows an integer value and a triple of integers for the rgb. Apart from the fact that I would need to specify the very same colour for a lot of values for a threshold based visualization, I would also need to convert my values to integers and in effect, lose the original values. The way I see it, this would not be a color table linked to values, but just colors stored in an indexed way. If you're lucky to match the Index palette to your values, then it works, but it's not a general purpose color table. – Andrei Aug 10 '20 at 12:17
  • 1
    TIFF supports color tables and GeoTIFF does not change that https://awaresystems.be/imaging/tiff/tifftags/colormap.html – user30184 Aug 10 '20 at 23:15
  • @user30184 That is a very limited color map, and it doesn't work with all tiffs (e.g. tiffs with float values). Also, the lookup table needs to be explicit. This is, at best, a very limited implementation of color tables. I can't know the intentions of this implementations, but it seems to be just a compressing technique using colormaps, and not a true colormap implementation. – Andrei Aug 21 '20 at 10:05
  • Paletted images are widely used for example with .png format http://www.libpng.org/pub/png/book/chapter08.html#png.ch08.div.5.1 and therefore a support for a similar palette TIFF feels natural. It is common to call a palette with other names, like colormap or color tables. The kind of color table you are after cannot be stored internally into a TIFF file. If you are interested in software specific methods I can try to find a few. Can you mention some image format that supports natively color tables as you wish? – user30184 Mar 02 '23 at 15:28

0 Answers0