2

I have a gray scale tiff image. I can extract the values from this tiff using numpy and make a new image with blue scale. But how can I convert it to shades of blue instead of shades of gray directly from the Tiff? Is it even possible?

Edit: Well I have two sets of tiff images(data), one with color-palette and another with gray scale ,I could generate tiles from color-palette one using generate_tiles.py, and show them on a map, but with gray scale one I can't do that, so I am wondering if I could change this gray scale tiff to color-palette one (with custom colours) so I can generate tiles and visualize the data.

Hornbydd
  • 43,380
  • 5
  • 41
  • 81
user27341
  • 47
  • 7

1 Answers1

1

It depends what you want exactly.

1) most GIS software will allow you to change the symbology of a one band raster in order to display it in scales of blue. In some cases you can can store a colormap with your image, but this implies some kind of discretization.

2) If you want a 'true' colored image, you need to create a three band RGB (red/green/blue). Therefore, stack two constant raster of zero value with your gray scale image (zeros/zeros/gray_scale). you can do this with gdalbuildvrt -separate (create vrt with 3 bands), then gdal_translate (vrt to tif). Note that this will increase the size of your image, and is thus rarely the best solution.

radouxju
  • 49,636
  • 2
  • 71
  • 144