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

Hamish hamish_nospam at yahoo.com
Tue Mar 23 22:04:52 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
> >
> > (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
> >
> >
> > (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 my system.
> This seems exactly as a problem I had with debug in grass57. The
> problem being that this must be declared as a shell (like bash)
> variable and has nothing to do with .grassrc (GRASS variable). It's
> also inclined in the fact you have to use 'export GRASS_TRUECOLOR',
> 'export' being the key word here.
> Markus then informed me that he working on a list. So you could add it
> to your bash of whatever shell (in .bashrc) or issue the command
> before starting GRASS. (Not sure if I'm completely right here, but
> that's how I understand it)

Ok, a couple of things are getting confused here,

There are two kinds of variables:

a) GRASS variables, set in .grassrc and (re)set with g.gisenv. These are
MAPSET, LOCATION_NAME, MONITOR, etc. These don't exist in the shell
unless you specifically create shell variables from them with the command
"eval `g.gisenv`".  e.g. "echo $MAPSET" doesn't work (in modern versions
of GRASS), you need to do "g.gisenv get=MAPSET" to see the value.

b) UNIX 'environmental' shell variables, which exist & persist in all
'children' processes if you use the "export" keyword. If you don't use
"export", they only exist in the current version of the shell. You can
set any GRASS specific environmental variables in a '.grass.bashrc' file.


Mac OSX 10.2 will generally use csh and "setenv GRASS_TRUECOLOR TRUE"
Mac OSX 10.3 will generally use bash and "export GRASS_TRUECOLOR=TRUE"

I'm not sure if the GRASS start up script checks .grass.bashrc if you
aren't actually running bash. I'd guess it would?


More information about the grass-dev mailing list