I have the following problem, I have a GeoTIFF file that is for now color interpreted as gray. When using gdalinfo I have the following results

Driver: GTiff/GeoTIFF
Files: out.tif
Size is 6957, 13662
Coordinate System is:
Origin = (92.138443059661412,28.568318690426047)
Pixel Size = (0.001364919790129,-0.001364919790129)
Image Structure Metadata:
Corner Coordinates:
Upper Left  (  92.1384431,  28.5683187) ( 92d 8'18.40"E, 28d34' 5.95"N)
Lower Left  (  92.1384431,   9.9207845) ( 92d 8'18.40"E,  9d55'14.82"N)
Upper Right ( 101.6341900,  28.5683187) (101d38' 3.08"E, 28d34' 5.95"N)
Lower Right ( 101.6341900,   9.9207845) (101d38' 3.08"E,  9d55'14.82"N)
Center      (  96.8863165,  19.2445516) ( 96d53'10.74"E, 19d14'40.39"N)
Band 1 Block=6957x1 Type=Float32, ColorInterp=Gray
  NoData Value=-9999

As you can see the colorInterp is shown as gray. So is there a way to have change this to green for example. The goal of this procedure would be then to use gdal2tiles.py to have a web representation of my GeoTIFF but I want it in another color than in a grayscale.


Setting a band color interpretation to "green" is meant for the RGB compositing (displaying three band of a multiband raster in the three primary color to obtain a full color image, and chosing which one of the three band will correspond to green). You could do it on a multiband raster using gdal_edit.py, but it would not be the right thing to do. In your case, what you need is more like a color map because you have only one band, but you want to display it with graduated colors.

This can be done with gdaldem, you can have a look at those answers : How to add a color table to a one band tiff using GDAL? and Changing color of raster images based on their data values - gdal

| improve this answer | |

Your Answer

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

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