[GRASS5] Re: [GRASSLIST:3252] r.colors color= proposal
Glynn Clements
glynn.clements at virgin.net
Sun Apr 25 09:57:56 EDT 2004
Hamish wrote:
> > Regarding grey.eq and grey.log: it's arguable that histogram
> > equalisation (linear and logarithmic) could be applied to any colour
> > scheme, not just grey-scale. In which case, maybe they should be a
> > separate option rather than a specific colour scheme.
>
> Interesting.. figuring out a log-color map by hand is a pain and doing
> something simple like 'r.mapcalc logmap=log(map)' is wasteful.
>
> I've also found being able to flip a colormap is often useful & doubles
> your possibilities without very much overhead. I guess that only works
> with all-percentage based rules however.
For absolute values, presumably you would use:
max - x' = x - min
=> x' = max - (x - min)
In which case, the obvious implementation would be to flip the colour
table after it has been created (and the percentages converted to
absolute values).
Histogram equalisation and log scales are a bit more involved. You
can't just transform the colours which form the endpoints of each
range. The obvious implementation is to create the base colour table
fromt the rules, then create a new colour table by looking up
transformed samples using the base table.
> All the predefined ones are
> percentage based though, with the exception of byg, byr, gyr, and ryg
> which all contain "0 white". Perhaps those 0 rules should be removed now
> that GRASS has NULL support?
Quite possibly; I just translated src/libes/gis/colr_*.c literally.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list