[GRASSLIST:1645] Re: automatic configuration of color table of a raster map

Hamish hamish_nospam at yahoo.com
Sun Nov 2 23:05:19 EST 2003

> Do you know any tools or commands which allow us to set and
> customize color table of a raster map in an automatic manner?
> Although we can set color table by r.colors and customize it
> by d.colors, we cannot set the range or assign specific colors
> to some special values (such as sea or filling values) without
> interactive manipulation. I would appreciate if some commands
> can support such functions automatically (capable for script).
> For example, I have more than 100 images of AVHRR/NDVI, and
> the water body is masked with a value of 255, and the cloud
> is masked with a value of 254, and the range of NDVI values
> is 0 to 100, and I want to assign rainbow colors to NDVI,
> black to water body, and white to cloud to every image.

try this in your script:

r.colors map=avhrr_map color=rules << EOF
0 yellow
20 green
40 0 255 255   # cyan
60 blue
80 magenta
100 red
101 grey
253 grey
254 white
255 black


More information about the grass-user mailing list