1pngdriver(1)                GRASS GIS User's Manual               pngdriver(1)
2
3
4

PNG DISPLAY DRIVER

6       PNG display driver to create PNG, PPM, or BMP images.
7

DESCRIPTION

9       The  PNG  driver  generates  PNG, PPM, or BMP images from GRASS display
10       commands. Per default PNG files are  written  with  this  driver.  This
11       driver is used by default if Cairo driver is not available.
12

USAGE

14   Environment variables
15       The  PNG  driver can be enabled by setting GRASS_RENDER_IMMEDIATE vari‐
16       able, eg.
17       export GRASS_RENDER_IMMEDIATE=png
18       Several environment variables affect the operation of the PNG driver:
19
20GRASS_RENDER_WIDTH=xxx
21               the width of the image map (default is 640).
22
23GRASS_RENDER_HEIGHT=yyy
24               the height of the image map (default is 480).
25
26GRASS_RENDER_BACKGROUNDCOLOR=RRGGBB
27               specifies the background color to use in RGB notation  (hex  or
28               R:G:B  values).  Named  colors  are  also supported. Default is
29               FFFFFF (white).
30
31GRASS_RENDER_TRANSPARENT=[TRUE|FALSE]
32               sets transparent background on (TRUE) or off (FALSE, default).
33
34GRASS_RENDER_TRUECOLOR=[TRUE|FALSE]
35               sets true-color support. Default is TRUE.
36
37GRASS_RENDER_FILE=filename
38               the filename to put the resulting image in, default is map.png.
39               If  you  set  GRASS_RENDER_FILE  to  a  filename  which ends in
40               ".ppm", a PPM file will be created (with alpha  channel  stored
41               in  a  PGM image, if applicable).  If you set GRASS_RENDER_FILE
42               to a filename which ends in ".bmp", a 32-bpp BMP file  will  be
43               created (these are not readable by some older viewers).
44
45GRASS_RENDER_FILE_COMPRESSION=[0|1|9]
46               compression  level  of  PNG  files  (0 = none, 1 = fastest, 9 =
47               best, default is 6)
48
49GRASS_RENDER_FILE_READ
50               if TRUE, the PNG driver will initialize the image from the con‐
51               tents of GRASS_RENDER_FILE.
52
53GRASS_RENDER_FILE_MAPPED
54               if  TRUE,  the  PNG  driver  will  map GRASS_RENDER_FILE as its
55               framebuffer, rather than using memory. This only works with BMP
56               files.
57
58   Example
59       export GRASS_RENDER_IMMEDIATE=png
60       export GRASS_RENDER_TRUECOLOR=TRUE
61       g.region raster=elevation
62       d.rast elevation
63       d.vect roadsmajor color=red
64       This writes a file named map.png in your current directory.
65

NOTES

67       The PNG driver uses the libpng (see the libpng home page) and zlib (see
68       the zlib home page), all which needs to be installed for the PNG driver
69       to work (it’s worth it).
70
71       The  resolution  of  the output images is defined by current region ex‐
72       tents. Use g.region -p to get the number of rows and cols and  use  the
73       environment variables to set the image size. If you would like a larger
74       image, multiply both rows and cols by the same whole number to preserve
75       the aspect ratio.
76
77       Further  PNG file processing (e.g. quantization to 1 bit for monochrome
78       images) can be done with pnmquant of the netpbm tools.
79

SEE ALSO

81        Cairo driver, PS driver, HTML driver, variables
82       d.rast, d.vect, d.mon, d.erase, d.redraw
83

AUTHORS

85       Original version: Per Henrik Johansen <phj (at) norgit.no>
86       Rewritten by: Glynn Clements, 2003
87
88       Main index | Topics index | Keywords index | Graphical index | Full in‐
89       dex
90
91       © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
92
93
94
95GRASS 8.2.1                                                       pngdriver(1)
Impressum