[GRASS5] color in GRASS - solved for PNG but I don't know why
michael.barton at asu.edu
Tue Mar 23 19:27:08 EST 2004
I've solved the problem but don't know why it is a problem. I've been
messing with this all day with various suggestions. I'm copying this to
the list in case it indicates an obscure bug that needs fixing.
Here is the situation:
I have a
statement in my .grassrc5 file (exactly this format, following the
format for other statements in the file)
When I ran a g.gisenv, it said that
(exactly this format). 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)
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
Do I need to change the format to
--using an equals sign instead of a colon? Is this some other kind of
error. It SEEMS that my other settings in .grassrc5 are being read
correctly (but now I'm unsure).
I tried tiff output using my script to send the display to the
cell_driver and then to r.out.tiff. However, it still looks 8bit.
Apparently, it is not convinced by the truecolor environment variable
On Tuesday, March 23, 2004, at 02:28 PM, Glynn Clements wrote:
> Michael Barton wrote:
>> Well, I THOUGHT this might be the magic solution.
>> I had GRASS_TRUECOLOR=true in lowercase. With great excitement, I just
>> tried it with GRASS_TRUECOLOR=TRUE (restarting GRASS, of course) and
>> sadly had the same result.
> 1. Which versions of GRASS/PNGdriver/GD are you using? The PNG driver
> in 5.0.x and 5.3 snapshots prior to 2003-10-31 only support 24-bit
> images if built using GD 2.x. 5.3 from 2003-10-31 onwards doesn't use
> GD, and always supports 24-bit images.
> 2. If you're using a suitable PNG driver, did you export the variable
> For bash, you need to use either:
> export GRASS_TRUECOLOR
> export GRASS_TRUECOLOR=TRUE
> [The latter is a bash extension; the former should work with all
> Bourne-style shells.]
> For C shells (csh, tcsh), the syntax is:
> setenv GRASS_TRUECOLOR TRUE
> Glynn Clements <glynn.clements at virgin.net>
Michael Barton, Professor & Curator
Department of Anthropology
Arizona State University
Tempe, AZ 85287-2402
voice: 480-965-6262; fax: 480-965-7671
More information about the grass-dev