QGIS – Finding Equivalent of ArcGIS ‘Delete Colormap’ Tool

colormapgeotiff-tiffqgisrasterstyle

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

Best Answer

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