[GRASS-user] Color table for multiple rasters

Hamish hamish_b at yahoo.com
Thu Oct 13 10:13:19 EDT 2011

Jitendra wrote:
> I need to create a histogram equalized color
> table for a set of rasters.
> I can use r.colors for each raster individually
> but then the color tables are not comparable
> across the maps. Any suggestions on how to
> create a color table across multiple rasters?

Nick wrote:
> Maybe you're looking for:
> r.colors map=$map rast=$other_map
> You can give each map the color table from one
> particular map and then it will be comparable
> across maps. You'll need to make sure you give it
> the color table from the map with the widest
> range though, or else you'll have some spots in
> your map with no color.

but if you base it on a master map you'll loose the
equalized histogram ability (across all maps in the

to overcome this, there is the r.stack addon module:


basically you collect all the series of maps into
one raster, create the equalized color table, then
using 'r.colors rast=' described in Nick's post copy
that overall color table to each component map.
(then delete the temporary stacked raster)


More information about the grass-user mailing list