[GRASS-user] Adjust opacity in command line

Glynn Clements glynn at gclements.plus.com
Tue Aug 28 07:19:54 PDT 2012


Andy Wickert wrote:

> I have been trying to find a way to adjust the opacity (or
> transparency, to throw another key word in there) of raster and vector
> layers using the command line. This is possible in the wxPython GUI,
> but I have a large number of maps to produce, and would like to script
> it. So if anyone knows if this is possible with the standard d.*
> commands, ps.map, or something else I don't know about - thanks in
> advance!

It isn't possible to directly generate images with partial opacity. 
wxGUI (via g.pnmcomp) uses the opacity values when compositing the
layers to form the displayed image.

You'll need to use general-purpose image-processing tools such as
ImageMagick, netpbm or Python+PIL. Blending between an empty
(fully-transparent) image and the source image is probably the easiest
approach.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list