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?
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?
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