123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html>
- <head>
- <title>PNG driver</title>
- <meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
- <link rel="stylesheet" href="grassdocs.css" type="text/css">
- </head>
- <body bgColor=white>
- <img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>
- <h2>NAME</h2>
- <em><b>PNG driver</b></em> - display driver to create PNG, PPM, or BMP images.
- <h2>DESCRIPTION</h2>
- 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 <em><a href="cairodriver.html">Cairo
- driver</a></em> is not available.
- <h2>USAGE</h2>
- <h3>Environment variables</h3>
- The PNG driver can be enabled by setting <b>GRASS_RENDER_IMMEDIATE</b>
- variable, eg.
- <div class="code"><pre>
- export GRASS_RENDER_IMMEDIATE=png
- </pre></div>
- Several environment variables affect the operation of the PNG driver:
- <ul>
- <li><b>GRASS_WIDTH=xxx</b><br>
- the width of the image map (default is 640).
- </li>
- <li><b>GRASS_HEIGHT=yyy</b><br>
- the height of the image map (default is 480).
- </li>
- <li><b>GRASS_BACKGROUNDCOLOR=RRGGBB</b><br>
- specifies the background color to use in RGB notation (hex or
- R:G:B values). Named colors are also supported. Default
- is <b>FFFFFF</b> (white).
- </li>
- <li><b>GRASS_TRANSPARENT=[TRUE|FALSE]</b><br>
- sets transparent background on (TRUE) or off (FALSE, default).
- </li>
- <li><b>GRASS_TRUECOLOR=[TRUE|FALSE]</b><br>
- sets true-color support. Default is TRUE.
- </li>
- <li><b>GRASS_PNGFILE=filename</b><br>
- the filename to put the resulting image in, default is <tt>map.png</tt>.
- 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).
- </li>
- <li><b>GRASS_PNG_COMPRESSION=[0|1|9]</b><br>
- compression level of PNG files (0 = none, 1 = fastest, 9 = best, default is 6)
- </li>
- <li><b>GRASS_PNG_READ</b><br>
- if <tt>TRUE</tt>, the PNG driver will initialize the image from
- the contents of GRASS_PNGFILE.
- </li>
- <li><b>GRASS_PNG_MAPPED</b><br>
- if <tt>TRUE</tt>, the PNG driver
- will map GRASS_PNGFILE as its framebuffer, rather than using
- memory. This only works with BMP files.
- </li>
- </ul>
- <h3>Example</h3>
- <div class="code"><pre>
- export GRASS_RENDER_IMMEDIATE=png
- export GRASS_TRUECOLOR=TRUE
- g.region rast=elevation
- d.rast elevation
- d.vect roadsmajor color=red
- </pre></div>
- This writes a file named <tt>map.png</tt> in your current directory.
- <h2>NOTES</h2>
- The PNG driver uses the libpng (see
- the <a href="http://www.libpng.org/pub/png/">libpng</a> home page) and
- zlib (see the
- <a href="http://www.zlib.net">zlib</a> home page), all which needs to
- be installed for the PNG driver to work (it's worth it).
- <p>The resolution of the output images is defined by current region
- extents. Use <tt>g.region -p</tt> 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.
- <p>Further PNG file processing (e.g. quantization to 1 bit for monochrome
- images) can be done with <tt>pnmquant</tt> of
- the <a href="http://netpbm.sourceforge.net/">netpbm</a> tools.
- <h2>SEE ALSO</h2>
- <em>
- <a href="cairodriver.html">Cairo driver</a>,
- <a href="psdriver.html">PS driver</a>,
- <a href="htmldriver.html">HTML driver</a>,
- <a href="variables.html">variables</a>
- <br><br>
- <a href="d.rast.html">d.rast</a>,
- <a href="d.vect.html">d.vect</a>,
- <a href="d.mon.html">d.mon</a>,
- <a href="d.erase.html">d.erase</a>,
- <a href="d.redraw.html">d.redraw</a>
- </em>
- <h2>AUTHOR</h2>
- Original version: Per Henrik Johansen <<i>phj (at)
- norgit.no</i>> <!-- broken link <I><a href="http://www.norgit.no">NORGIT AS</a></i> -->
- <br>
- Rewritten by: Glynn Clements, 2003
- <p><i>Last changed: $Date$</i>
|