.TH pngdriver 1grass "" "GRASS 6.4.2" "Grass User's Manual" .SH NAME \fI\fB PNG driver\fR\fR - driver to create PNG and PPM images. .br \fI(drivers)\fR .SH DESCRIPTION The PNG driver generates PNG and PPM images from GRASS display commands. Per default PNG files are written with this driver. It is started as 'pseudo' monitor (image file instead) and when stopped, all output from previously used display commands are written to the PNG image file. .SH USAGE .SS Environment variables Several environment variables effect the operation of the PNG driver. .RS \fBGRASS_WIDTH=xxx\fR .br the width of the image map (default is 640). .br \fBGRASS_HEIGHT=yyy\fR .br the height of the image map (default is 480). .br \fBGRASS_PNGFILE=filename\fR .br the filename to put the resulting image in, default is map.png. If you set GRASS_PNGFILE to a filename which ends in ".ppm", a PPM file will be created (with alpha channel stored in a PGM image, if applicable). If you set GRASS_PNGFILE to a filename which ends in ".bmp", a 32-bpp BMP file will be created (these are not readable by some older viewers). .br \fBGRASS_BACKGROUNDCOLOR=RRGGBB\fR .br specifies the background color to use in RGB notation (hex values). Default is \fB000000\fR (black). .br \fBGRASS_TRANSPARENT=[TRUE|FALSE]\fR .br sets transparent background on (TRUE) or off (FALSE, default). .br \fBGRASS_TRUECOLOR=[TRUE|FALSE]\fR .br sets true-color support .br \fBGRASS_PNG_COMPRESSION=[0|1|9]\fR .br compression level of PNG files (0 = none, 1 = fastest, 9 = best, default is 6) .br \fBGRASS_PNG_AUTO_WRITE=[TRUE|FALSE]\fR .br if set to TRUE, the image file will be written after each operation (i.e. whenever a client disconnects), rather than only being written out when the driver terminates. .br \fBGRASS_PNG_READ\fR .br if TRUE, the PNG driver will initialize the image from the contents of GRASS_PNGFILE. .br \fBGRASS_PNG_MAPPED\fR .br if TRUE, the PNG driver will map GRASS_PNGFILE as its framebuffer, rather than using memory. This only works with BMP files. .br \fBGRASS_RENDER_IMMEDIATE=[TRUE|FALSE]\fR .br tells the raster library to use its built-in PNG driver rather than connecting to an external monitor process using sockets. If TRUE, there is no need to run d.mon start=PNG. .RE .SS Example ..IP Define driver settings (here: bash shell syntax) \fC .DS .br export GRASS_RENDER_IMMEDIATE=TRUE .br export GRASS_TRUECOLOR=TRUE .br .DE \fR Start up the driver \fC .DS .br d.mon start=PNG .br .DE \fR Display raster map and vector polygons \fC .DS .br d.rast \fIsomerastermap\fR .br d.vect \fIsomevectormap\fR color=red .br .DE \fR Stop the driver subsequently. This will write a file named map.png to be created in your current directory: \fC .DS .br d.mon stop=PNG .br .DE \fR .PP .SH NOTES The PNG driver uses the libpng (see the libpng home page) and zlib (see the zlib home page), all which needs to be installed for the PNG driver to work (it's worth it). .PP The resolution of the \fIPNG\fR raster map is defined by the map extents. Use \fIg.region -p\fR to get the number of rows and cols and use the environment variables to set the PNG size. If you would like a larger image, multiply both rows and cols by the same whole number to preserve the aspect ratio. .PP Further PNG file processing (e.g. quantization to 1 bit for monochrome images) can be done with 'pnmquant' of the netpbm tools. .SH SEE ALSO \fI Display drivers .br HTMLMAP driver, PostScript driver, XDRIVER .br d.frame, d.mon, d.rast, d.vect \fR .SH AUTHOR Original version: Per Henrik Johansen \fINORGIT AS\fR .br Rewritten by: Glynn Clements, 2003 .PP \fILast changed: $Date: 2010-02-18 01:23:37 +0100 (Thu, 18 Feb 2010) $\fR .PP Full index .PP © 2003-2011 GRASS Development Team