[GRASS5] color in GRASS

Glynn Clements glynn.clements at virgin.net
Tue Mar 23 07:06:04 EST 2004


Hamish wrote:

> > As part of my menu updating, I've added some ways to more easily get 
> > GRASS output into other programs.
> > This involves using the cell driver, coupled with r.out.tiff, and the
> > PNG driver. These work well, but the output leaves something to be
> > desired. It seems primarily due to a very minimal color-depth
> > supported by both of these routines. I've seen a bit of discussion on
> > this recently, but nothing definitive.
> > 
> > How difficult is it to at least get 24bit color (or perhaps even get 
> > wild with 32bit) to these output routines? It would be nice to include
> > GRASS output that looks as nice as the displays do. Currently, my only
> > option for doing this is via xwd.
> 
> 
> for the PNG driver, when you do "d.mon start=PNG", does it say:
> "PNG: GRASS_TRUECOLOR status: TRUE"
> 
> ?
> 
> to turn it on, you need to do:
> export GRASS_TRUECOLOR=TRUE
> 
> These both currently fail by the way -- they probably shouldn't:
> GRASS_TRUECOLOR=1
> GRASS_TRUECOLOR=true
> 
> Now we don't have GD to worry about, should GRASS_TRUECOLOR be set to 
> TRUE by default?

The reason why I originally made it default to off was for backwards
compatibility. All previous versions of the PNG driver created 8-bit
paletted images (either PNG or GIF), and I didn't want the changes to
bite anyone who was relying upon existing behaviour.

Even if 24-bit support is always available, there are valid reasons
for creating a paletted image. One reason is that they will tend to be
smaller, which can be important for images which are to be used on web
sites.

FWIW, it would be nice to have a cleaner mechanism than an environment
variable for selecting 8/24 bit images. A command-line option is one
possibility, but that's potentially messy given the d.mon -> mon.start
-> driver chain. Another option would be creating separate PNG8/PNG24
drivers.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list