Rechercher une page de manuel

Chercher une autre page de manuel:


Langue: en

Autres versions - même langue

Version: 370397 (fedora - 01/12/10)

Section: 1 (Commandes utilisateur)


PNG driver - driver to create PNG and PPM images


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.


Environment variables

Several environment variables effect the operation of the PNG driver.
the width of the image map (default is 640).
the height of the image map (default is 480).
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.

specifies the background color to use in RGB notation (hex values). Default is 000000 (black).
sets transparent background on (TRUE) or off (FALSE, default).
sets true-color support
compression level of PNG files (0 = none, 1 = fastest, 9 = best, default is 6)
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.
if "TRUE", the PNG driver will initialize the image from the contents of $GRASS_PNGFILE.
if "TRUE", the PNG driver will map $GRASS_PNGFILE as its framebuffer, rather than using memory. This only works with BMP files.
tells the raster library to use its built-in PNG driver rather than connecting to an external monitor process using sockets. If dqTRUE", there is no need to run "d.mon start=PNG"



         export GRASS_TRUECOLOR=TRUE

         d.mon start=PNG
Display raster map and vector polygons

         d.rast somerastermap

         d.vect 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


The PNG driver uses the 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).

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. If you would like a larger image, multiply both rows and cols by the same whole number to preserve the aspect ratio.

Further PNG file processing (e.g. quantization to 1 bit for monochrome images) can be done with 'pnmquant' of the netpbm tools.


HTML map driver, PostScript driver, XDRIVER
d.frame, d.mon, d.rast, d.vect


Original version:
Per Henrik Johansen


Rewritten by Glynn Clements, 2003

Last changed: $Date: 2007-09-01 19:40:57 +0200 (Sat, 01 Sep 2007) $

Full index

© 2003-2008 GRASS Development Team

Nous avons toutefois un support téléphonique que vous pouvez joindre
sans hésitation au (+32)xxxxxxxxx. Ce support téléphonique n'a pas
encore d'horaire et peut-être soit allumé, soit éteint.
-- Jayce - Dodo --