[gdal-dev] gdal_translate -expand rgba behaving incorrectly, pct2rgb.py working correctly on a tif

B H hemantbist at gmail.com
Wed Mar 6 14:16:41 PST 2024


Hi,
I am processing a bunch of tifs where the gdal_translate and pct2rgb.py
seem to be behaving differently.
Is it a bug in gdal_translate, or I need to pass some options to get
correct behavior.

gdal_translate -expand rgba  a.tif  gdalbad.tif  # This produces a tif file
with _incorrect_ colors.
pct2rgb.py -rgba a.tif  gdalgood.tif # This produces the tif file with
correct colors.

I am using QGIS to view all the tif files.

I have tried it on gdal 3.4.3 and on some earlier versions. The  behaviour
is the same.
I have also opened a bug mainly to attach the sample tif file.
https://github.com/OSGeo/gdal/issues/9402

Best,
HB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240306/9fa1f623/attachment.htm>


More information about the gdal-dev mailing list