[GIS] How to convert a RGB tiff into pseudocolor with GDAL etc

gdalosxqgis

In QGIS I have made a singleband pseudocolor image out of one of the bands from a RGB GeoTiff. I choose one band and then make a linear color interpolation (see attached image).

screen shot from QGIS

I now want to do the same thing the command line way (GDAL/Mapnik/etc) so I can get a workflow going, but I don't really know where to start?

My idea is to split the RGB image into three greyscale files for each band and then give each band a pseudocolor map. Any ideas of how to do this?

Best Answer

So I figured it out!

  1. gdal_translate -b 2 input_rgb.tiff output_green.tiff
  2. gdaldem color-relief output_green.tiff green_colortable.txt output_green_rgb.tiff taking the colortable from QGIS.

I did this for both red and green bands. After that I combined them by using Mapnik!