Your company here — click to reach over 10,000 unique daily visitors

g.pnmcomp.1grass - Man Page

Overlays multiple PPM image files.


general, display


g.pnmcomp --help
g.pnmcomp input=name[,name,...]  [mask=name[,name,...]]   [opacity=float[,float,...]]  output=name  [output_mask=name]  width=integer height=integer  [bgcolor=name]   [--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]



Allow output files to overwrite existing files


Print usage summary


Verbose module output


Quiet module output


Force launching GUI dialog


input=name[,name,...] [required]

Name of input file(s)


Name of input mask file(s)


Layer opacities

output=name [required]

Name for output file


Name for output mask file

width=integer [required]

Image width

height=integer [required]

Image height


Background color
Either a standard color name or R:G:B triplet


g.pnmcomp isn’t meant for end users. It’s an internal tool for use by wxGUI.

In essence, g.pnmcomp generates a PPM image by overlaying a series of PPM/PGM pairs (PPM = RGB image, PGM = alpha channel).


The intention is that d.* modules will emit PPM/PGM pairs (by way of the PNG-driver code being integrated into Display Library). The GUI will manage a set of layers; each layer consists of the data necessary to generate a PPM/PGM pair. Whenever the layer "stack" changes (by adding, removing, hiding, showing or re-ordering layers), the GUI will render any layers for which it doesn’t already have the PPM/PGM pair, then re-run g.pnmcomp to generate the final image (just redoing the composition is a lot faster than redrawing everything).

A C/C++ GUI would either have g.pnmcomp’s functionality (image composition) built-in, or would use the system’s graphics API to perform composition (for translucent layers, you would need OpenGL or the Render extension, or something else which supports translucent rendering).

Tk doesn’t support transparent (masked) true-colour images (it does support transparent GIFs, but that’s limited to 256 colours), and an image composition routine in Tcl would be unacceptably slow, hence the existence of g.pnmcomp.

See Also



Glynn Clements

Source Code

Available at: g.pnmcomp source code (history)

Accessed: Tuesday May 14 13:39:59 2024

Main index | General index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.3.2 Reference Manual


GRASS 8.3.2 GRASS GIS User's Manual