.TH pngdriver 1grass "" "GRASS 7.8.5" "GRASS GIS User's Manual" .SH PNG DISPLAY DRIVER \fIPNG display driver\fR to create PNG, PPM, or BMP images. .SH DESCRIPTION The PNG driver generates PNG, PPM, or BMP images from GRASS display commands. Per default PNG files are written with this driver. This driver is used by default if \fICairo driver\fR is not available. .SH USAGE .SS Environment variables The PNG driver can be enabled by setting \fBGRASS_RENDER_IMMEDIATE\fR variable, eg. .br .nf \fC export GRASS_RENDER_IMMEDIATE=png \fR .fi Several environment variables affect the operation of the PNG driver: .RS 4n .IP \(bu 4n \fBGRASS_RENDER_WIDTH=xxx\fR .br the width of the image map (default is 640). .IP \(bu 4n \fBGRASS_RENDER_HEIGHT=yyy\fR .br the height of the image map (default is 480). .IP \(bu 4n \fBGRASS_RENDER_BACKGROUNDCOLOR=RRGGBB\fR .br specifies the background color to use in RGB notation (hex or R:G:B values). Named colors are also supported. Default is \fBFFFFFF\fR (white). .IP \(bu 4n \fBGRASS_RENDER_TRANSPARENT=[TRUE|FALSE]\fR .br sets transparent background on (TRUE) or off (FALSE, default). .IP \(bu 4n \fBGRASS_RENDER_TRUECOLOR=[TRUE|FALSE]\fR .br sets true\-color support. Default is TRUE. .IP \(bu 4n \fBGRASS_RENDER_FILE=filename\fR .br the filename to put the resulting image in, default is map.png. If you set GRASS_RENDER_FILE to a filename which ends in \(dq.ppm\(dq, a PPM file will be created (with alpha channel stored in a PGM image, if applicable). If you set GRASS_RENDER_FILE to a filename which ends in \(dq.bmp\(dq, a 32\-bpp BMP file will be created (these are not readable by some older viewers). .IP \(bu 4n \fBGRASS_RENDER_FILE_COMPRESSION=[0|1|9]\fR .br compression level of PNG files (0 = none, 1 = fastest, 9 = best, default is 6) .IP \(bu 4n \fBGRASS_RENDER_FILE_READ\fR .br if TRUE, the PNG driver will initialize the image from the contents of GRASS_RENDER_FILE. .IP \(bu 4n \fBGRASS_RENDER_FILE_MAPPED\fR .br if TRUE, the PNG driver will map GRASS_RENDER_FILE as its framebuffer, rather than using memory. This only works with BMP files. .RE .SS Example .br .nf \fC export GRASS_RENDER_IMMEDIATE=png export GRASS_RENDER_TRUECOLOR=TRUE g.region raster=elevation d.rast elevation d.vect roadsmajor color=red \fR .fi This writes a file named map.png in your current directory. .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\(cqs worth it). .PP The resolution of the output images is defined by current region extents. Use g.region \-p to get the number of rows and cols and use the environment variables to set the image 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 Cairo driver, PS driver, HTML driver, variables .br .br d.rast, d.vect, d.mon, d.erase, d.redraw \fR .SH AUTHOR Original version: Per Henrik Johansen <\fIphj (at) norgit.no\fR> .br Rewritten by: Glynn Clements, 2003 .PP Main index | Topics index | Keywords index | Graphical index | Full index .PP © 2003\-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual