[GRASS5] color in GRASS

Glynn Clements glynn.clements at virgin.net
Tue Mar 23 06:43:49 EST 2004


Michael Barton wrote:

> How difficult is it to at least get 24bit color (or perhaps even get 
> wild with 32bit) to these output routines?

For 24-bit colour, you need either the recent (GD-less) 5.3 PNG
driver, or an older PNG driver which was built with GD 2.x. In either
case, you need to use:

	export GRASS_TRUECOLOR=TRUE

before starting the PNG driver. You will then get 32-bit PNG files: 8
bits of each of red, green, blue and alpha. The alpha channel will be
completely opaque, unless you also use:

	export GRASS_TRANSPARENT=TRUE

in which case any pixels which aren't drawn will be transparent.

I'm not sure what you mean by 32-bit colour. The term is sometimes
used to refer to formats which have an alpha channel, but it can also
refer to 24-bit data with 8 bits of padding so that pixels are aligned
to word boundaries (for performance reasons).

When referring to display depth (e.g. in the Display properties dialog
on Windows), 32-bit corresponds to the latter, i.e. the extra 8 bits
are just padding.

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




More information about the grass-dev mailing list