[GRASSLIST:3618] Re: function to compare rasters visually
glynn.clements at virgin.net
Mon Jun 7 18:47:59 EDT 2004
Benjamin Ducke wrote:
> Dissolve seems to be what graphics programs like
> Photoshop call "transparency" and is usually
> implemented using an alpha blending.
> It should not be too hard to implement something
> like this in a GRASS rast module.
> The Open Source program Gimp (www.gimp.org) should have all
> the necessary algorithms.
> Also, Graphics Gems (Vol. I) has an alpha blending algorithm.
> I would like to see something like this in a GRASS module,
> but I really think alpha blending should be done by adding the
> needed functionality to d.rast. Maybe one could add an integer
> 1..100 to the '-o' parameter to specifiy the strength of
> While we are at it: I would love to see antialiasing for
> vector maps (d.vect), it makes them so much easier on the eyes.
> Are there any capabale graphics programmers who would implement it
> (come on - shouldn't be that hard) ?
GRASS' display architecture doesn't support translucency, so you can't
blend with what is already on the monitor.
If you want a blend between two maps, you have to rasterise both,
blend the results yourself, then draw the blended result. E.g.
# Usage: d.blend.sh <map1> <k1> <map2> <k2>
R = ($k1 * r#$map1 + $k2 * r#$map2) / ($k1 + $k2)
G = ($k1 * g#$map1 + $k2 * g#$map2) / ($k1 + $k2)
B = ($k1 * b#$map1 + $k2 * b#$map2) / ($k1 + $k2)
r.colors R color=rules <<EOF
r.colors G rast=R
r.colors B rast=R
r.composite r_map=R g_map=G b_map=B output=blend
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-user