I want to add color, using RGB values stored in a CPT file, to a black and white Int16 GeoTIFF file using Python.

I tried to use SetColorEntry(), but when I add the ColorTable to the RasterBand, I get the following error:

ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format.

The GeoTIFF is a bathymetry where the values range from -5000 to 50. Using Byte or UInt16 would result in a lot of data loss

Can someone help me out and point me in the right direction?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.