<div dir="ltr">Hi,<div>I am processing a bunch of tifs where the gdal_translate and pct2rgb.py seem to be behaving differently.</div><div>Is it a bug in gdal_translate, or I need to pass some options to get correct behavior.</div><div><br><div>gdal_translate -expand rgba  a.tif  gdalbad.tif  # This produces a tif file with _incorrect_ colors.</div><div>pct2rgb.py -rgba a.tif  gdalgood.tif # This produces the tif file with correct colors.<br></div></div><div><br></div><div>I am using QGIS to view all the tif files.</div><div><br></div><div>I have tried it on gdal 3.4.3 and on some earlier versions. The  behaviour is the same.</div><div>I have also opened a bug mainly to attach the sample tif file.</div><div><a href="https://github.com/OSGeo/gdal/issues/9402">https://github.com/OSGeo/gdal/issues/9402</a><br></div><div><br></div><div>Best,</div><div>HB</div></div>