[GRASS5] d.rgb: different display in gis.m and d.m

Hi,

Please see the attched screendumps. Both are the output of 'd.rgb
red=d.r green=d.g blue=d.b -o' called from gis.m (rgb_tcltk.png) and
d.m (rgb_mon.png) respectively. Why is the first one different? The
latter one (rgb_mon.png) seems correct, as r.composite output is
identical.

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

(attachments)

rgb_mon.png
rgb_tcltk.png

Additional note:

Removing the the -o switch from d.rgb command in gis.m makes it display
the composition properly. Only with -o turned on the display is wrong.

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

Maciek,

I *THINK* you've hit a bug I reported in d.rgb and d.his about a month back.
I'm pretty sure that they treat "0" as NULL. This is probably a holdover
from the old 'pre-NULL' days of GRASS. Does your map use "0"s? If so, try
changing to another value and see what happens.

I don't know why it's showing up in gis.m and not in d.m, but probably has
to do with the x11 vs. PNG/PPM display driver architecture. I'm adding Glynn
to the copy list because he may have some insight into what is going on.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Maciek Sieczka <werchowyna@epf.pl>
Date: Mon, 1 May 2006 13:40:29 +0200
To: <grass5@grass.itc.it>
Cc: <michael.barton@asu.edu>, <cedricgrass@shockfamily.net>,
<hamish_nospam@yahoo.com>
Subject: d.rgb: different display in gis.m and d.m

Hi,

Please see the attched screendumps. Both are the output of 'd.rgb
red=d.r green=d.g blue=d.b -o' called from gis.m (rgb_tcltk.png) and
d.m (rgb_mon.png) respectively. Why is the first one different? The
latter one (rgb_mon.png) seems correct, as r.composite output is
identical.

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko
najlepsze z nich!
http://katalog.panoramainternetu.pl/

Michael Barton wrote:

I *THINK* you've hit a bug I reported in d.rgb and d.his about a month back.
I'm pretty sure that they treat "0" as NULL. This is probably a holdover
from the old 'pre-NULL' days of GRASS. Does your map use "0"s? If so, try
changing to another value and see what happens.

I don't know why it's showing up in gis.m and not in d.m, but probably has
to do with the x11 vs. PNG/PPM display driver architecture. I'm adding Glynn
to the copy list because he may have some insight into what is going on.

The PNG driver uses the fallback implementation for RGB rasters, which
converts the R/G/B values to internal colour numbers then uses the
RASTER_INT operation. This does the wrong thing if the internal colour
number is zero (and black on an RGB device probably will be zero) and
overlay mode is being used.

I'll change it to provide its own RGB raster operation.

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

Thanks very much. This seems to explain the behavior I got too.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Glynn Clements <glynn@gclements.plus.com>
Date: Mon, 1 May 2006 18:07:51 +0100
To: Michael Barton <michael.barton@asu.edu>
Cc: Maciek Sieczka <werchowyna@epf.pl>, <grass5@grass.itc.it>, Cedric Shock
<cedricgrass@shockfamily.net>, Hamish <hamish_nospam@yahoo.com>
Subject: Re: [GRASS5] Re: d.rgb: different display in gis.m and d.m

Michael Barton wrote:

I *THINK* you've hit a bug I reported in d.rgb and d.his about a month back.
I'm pretty sure that they treat "0" as NULL. This is probably a holdover
from the old 'pre-NULL' days of GRASS. Does your map use "0"s? If so, try
changing to another value and see what happens.

I don't know why it's showing up in gis.m and not in d.m, but probably has
to do with the x11 vs. PNG/PPM display driver architecture. I'm adding Glynn
to the copy list because he may have some insight into what is going on.

The PNG driver uses the fallback implementation for RGB rasters, which
converts the R/G/B values to internal colour numbers then uses the
RASTER_INT operation. This does the wrong thing if the internal colour
number is zero (and black on an RGB device probably will be zero) and
overlay mode is being used.

I'll change it to provide its own RGB raster operation.

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