NAME
PNG driver - driver to create PNG images
(drivers)
DESCRIPTION
The PNG driver generates PNG pictures from GRASS display commands.
USAGE
Environment variables
Several environment variables effect the operation
of the PNG driver.
- GRASS_WIDTH=xxx
the width of the image map (default is
640).
- GRASS_HEIGHT=yyy
the height of the image map (default is
480).
- GRASS_PNGFILE=filename
the filename to put the resulting image in, default is map.png.
- GRASS_BACKGROUNDCOLOR=RRGGBB
specifies the background color to use in RGB
notation (hex values). Default is 000000 (black).
- GRASS_TRANSPARENT=[TRUE|FALSE]
sets transparent background on (TRUE) or off (FALSE,
default).
- GRASS_TRUECOLOR=[TRUE|FALSE]
sets true-color support if
built with GD-2.0
Example
- Start up the driver
d.mon start=PNG
d.mon select=PNG
- Display raster map and vector polygons
d.rast somerastermap
d.vect map=somevectormap color=red
- Stop the driver subsequently. This will write a
file named map.png to be created in your current directory:
d.mon stop=PNG
NOTES
The PNG driver uses the Gd library
(http://www.boutell.com/gd/) developed by Boutell.Com, Inc. The Gd library
in turn relies on libpng (see the libpng home page) and zlib (see
the info-zip home
page), all which needs to be installed for the PNG driver to work (it's
worth it).
Note that the PNG driver is limited to 8bit colors when compiled against libgd1.x.
From libgd2.x onwards true color support is optionally provided.
The resolution of the PNG raster map is defined by the map
extents. Use g.region -p to get the number of rows and cols and
use the environment variables to set the PNG size.
SEE ALSO
HTMLMAP driver,
celldriver,
XDRIVER,
d.area,
d.mon,
d.vect
AUTHOR
Per Henrik Johansen
phj@norgit.no
NORGIT AS
Last changed: $Date: 2002/06/08 14:43:02 $