[GRASS-dev] d.his vs. r.his

Glynn Clements glynn at gclements.plus.com
Thu Oct 25 03:56:47 EDT 2007

Hamish wrote:

> I am trying to recreate the 'd.his brighten=' effect with r.his, but
> with r.his along with the brightness I get extremely high contrast
> output.
> e.g.
> #spearfish  d.out.file help page example
> r.shaded.relief map=elevation.dem shad=elev.shad_relf

$ r.info -r elev.shad_relf

> r.mapcalc "elev.shad_relf_bright50 = elev.shad_relf * 1.5"
> r.his h=elevation.dem i=elev.shad_relf_bright50 r=esr.r g=esr.g b=esr.b
> d.rgb r=esr.r g=esr.g b=esr.b
> # versus
> d.his h=elevation.dem i=elev.shad_relf brighten=50
> ?

You're forgetting the colour tables. Twice.

First, r.mapcalc needs to use the intensities for elev.shad_relf, not
its values.

Second, r.his uses the intensities for elev.shad_relf_bright50, not
its values. As you aren't setting a colour table, you get the default
rainbow colours.

Try this instead:

	r.mapcalc 'elev.shad_relf_bright50 = #elev.shad_relf * 1.5'
	r.colors elev.shad_relf_bright50 color=grey255
	d.rgb r=esr.r g=esr.g b=esr.b

It gives results similar to d.his.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list