[GRASS5] color in GRASS - solved for PNG but I don't know why

Michael Barton michael.barton at asu.edu
Wed Mar 24 11:27:00 EST 2004


On Wednesday, March 24, 2004, at 06:34  AM, Glynn Clements wrote:

>> (exactly this format).
>
> Neither of these are relevant. The PNG driver looks for an
> envioronment variable named GRASS_TRUECOLOR, not a GRASS variable.
> ~/.grassrc5 and g.gisenv deal with GRASS variables, not environment
> variables.
>
>> When I typed d.mon start=PNG it responded
>>
>>     PNG: GRASS_TRUECOLOR status: FALSE
>>
>> (exactly this format). So, I have the right version of PNG and the
>> correct statement in .grassrc5, but PNG didn't know to use truecolor.
>>
>> So, I tried to set this variable at the shell level using
>>
>> setenv GRASS_TRUECOLOR TRUE
>>
>> (quitting GRASS first, then restarting)
>
> OK; although you can also set that variable within GRASS, so long as
> it's set before starting the PNG driver.

This is working for normal PNG output, but doesn't seem to be working 
for d.dm. I don't see anything in the d.dm script that resets the 
GRASS_TRUECOLOR variable. However, it shows as being set to TRUE in my 
environment (run setenv from the shell for csh), but shows as FALSE 
when d.dm creates PNG output. This is the case even if I set it before 
starting GRASS.

>
>> Now GRASS creates a 332 Kb PNG file that DOES look like the screen.
>> Clearly it IS now producing a 24 bit graphic image. Apparently, the
>> truecolor statement in the .grassrc5 file is not parsing correctly on
>> my system.
>
> ~/.grassrc5 isn't relevent here.

OK. So what's the point of the GRASS_TRUECOLOR variable in the 
.grassrc5 file?

>
> The CELL driver is limited to 8 bits; I'm not aware of any plans to
> change this.

After a lot of playing around, I finally discovered this (very last 
line of the man page).

> 'm not sure if the CELL driver is really useful any
> more. FWIW, you can always use the PNG driver plus r.in.png.

Is there some way to redirect output from the PNG driver to r.in.png? 
It seems to be doing it's thing in the background. If there is, I could 
perhaps come  up with a way to get 24bit tiff output of a display.

______________________________
Michael Barton, Professor & Curator
Department of Anthropology
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671




More information about the grass-dev mailing list