3

I have many TIF rasters with colormaps. In ArcGIS I can delete these with "Delete Colormap" tool.

Is there a QGIS equivalent of this tool, or some other way of deleting them?

enter image description here

1 Answer 1

5

I did not find ready made tool for that. Could be a good option to add into gdal_edit.py.

Meanwhile you can remove the colortable with GDAL and Python. Writing an empty colortable seems to effect like delete.

from osgeo import gdal

ds = gdal.Open('palette.tif',gdal.GA_Update)
ct = gdal.ColorTable()
ds.GetRasterBand(1).SetRasterColorTable(ct)
ct = None
ds = None

Before:

Band 1 Block=1000x8 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)

After:

Band 1 Block=1000x8 Type=Byte, ColorInterp=Gray

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.