[GRASS-user] colortable RGB value for a pixel based on its value?

Hi there.

I’m trying to do dome tricks with r.colors.stddev and was wondering if there is a way to know which RGB value will be assigned to a raster value? More precisely, I want to use the r.colors.stddev scheme in a moving-window, so that the central pixel is colored using r.colors.stddev but using only the values of its surrounding pixels.

best

Carlos


Prof. Carlos Henrique Grohmann
Institute of Geosciences - Univ. of São Paulo, Brazil

  • Digital Terrain Analysis | GIS | Remote Sensing -

http://carlosgrohmann.com


Can’t stop the signal.

Hi,
José Guerrero published a Python script to produce a raster (*. Asc) with
the sum of neighboring pixels.
Script de python para producir un ráster (*.asc) con la suma de los píxeles
vecinos
<http://joseguerreroa.wordpress.com/2012/08/03/script-de-python-para-producir-un-raster-asc-con-la-suma-de-los-pixeles-vecinos/&gt;

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/colortable-RGB-value-for-a-pixel-based-on-its-value-tp5009955p5010020.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Carlos Grohmann wrote:

I'm trying to do dome tricks with r.colors.stddev and was wondering if
there is a way to know which RGB value will be assigned to a raster value?
More precisely, I want to use the r.colors.stddev scheme in a
moving-window, so that the central pixel is colored
using r.colors.stddev but using only the values of its surrounding pixels.

Use r.neighbors and r.mapcalc, e.g.:

tmpmap=colors_stddev.tmp.$$
r.neighbors "input=$inmap" "output=$tmpmap.mean" method=average
r.neighbors "input=$inmap" "output=$tmpmap.sdev" method=stddev
r.mapcalc "$outmap = ($inmap - $tmpmap.mean) / $tmpmap.sdev"
r.colors "$outmap" rules=- <<EOF
0% blue
-2 blue
0 white
2 red
100% red
EOF
g.remove "rast=$tmpmap.mean,$tmpmap.sdev"

--
Glynn Clements <glynn@gclements.plus.com>