[gdal-dev] how to preserve color-interpretation when merging TIFFs and adding alpha band with gdalbuildvrt+gdalwarp?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] how to preserve color-interpretation when merging TIFFs and adding alpha band with gdalbuildvrt+gdalwarp?

Raphael Das Gupta
Heya GDALers

Is someone here able to answer
https://gis.stackexchange.com/q/274775/51574 ? (I didn't get any answers
on GIS Stack Exchange, yet. If more information is needed, please let me
know here or on Stack Exchange.)

Is my approach (i.e. aiming to preserve color interpretation) even the
right one, or should I instead try to convert everything to RGB?

Kind regards,
Raphael
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: how to preserve color-interpretation when merging TIFFs and adding alpha band with gdalbuildvrt+gdalwarp?

Even Rouault-2
On mardi 27 mars 2018 15:11:31 CEST Raphael Das Gupta wrote:
> https://gis.stackexchange.com/q/274775/51574

If you use latest GDAL 2.2.4, you don't even need to add -setci to gdalwarp
The fact that the resulting raster doesn't display well by default with QGIS
2.18 (actually I also find it to be the case with a QGIS 3 dev version) is
just a small glitch of QGIS itself that doesn't recognize by default a file
with a band with a color palette and an alpha band, but the file itself is
just fine. Please file a QGIS ticket for that.

Regarding the palette having 256 entries rather than 2, this is a feature of
the TIFF format itself. When you add the alpha band, we need 8 bit depth, so
the color table has 256 entries. If you didn't need an alpha band, then adding
-co NBITS=1 would have recreated a 1-bit depth file.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev