Output transparent figures
Arlindo da Silva
arlindo.dasilva at GMAIL.COM
Wed Jul 1 15:05:41 EDT 2009
On Wed, Jun 24, 2009 at 10:58 AM, Stephen R McMillan <
smcmillan at planalytics.com> wrote:
> Wang,
>
> Try using the "-t" (transparent) option with printim. For example,
>
> 'printim image.png -t 0' should produce an image with a transparent
> background (assuming background is color 0).
>
> Reference from GrADS Documentation Index:
> http://grads.iges.org/grads/gadoc/gradcomdprintim.html
>
> Note: I believe the transparent option will work only with versions 1.9 or
> later.
>
Recently Pablo Romero implemented additional transparency functionality in
the gxyat extension. For example, you can specify a transparency level for
each color with the set_rgba command extension. You will need the latest
OpenGrADS bundle release available from http://opengrads.org. Notice that
you have to use "gxyat" instead of "printim" for enabling this feature; this
will also give you smoother fonts. A manual page is built in:
ga-> set_rgba
NAME
set_rgba - define color including alpha channel
SYNOPSIS
set_rgba color red green blue alpha [mask]
DESCRIPTION
This User Defined Command (UDC) defines *color* given its
RGB triplet along with its *alpha* channel.
color integer in the range [16-255]
red,
green,
blue integers in the range [0-255]
alpha float, with alpha ranging from 0.0 (fully transparent)
to 1.0 (fully opaque).
The optional parameter *mask* determines whether the color below
it is visible or not.
mask=0 --- if alpha<1, *color* will be semi-transparent and the
colors below it will be visible (default)
mask=1 --- if alpha<1, *color* will be semi-transparent but the
colors below it will *not* be visible
EXAMPLE
In order to emulate the -t option in printim
ga-> set rgb 60 125 125 125
ga-> printim img.png -t 60
Specify alpha=0 and mask=1
ga-> set_rgba 60 125 125 125 0 1
ga-> gxyat img.png
--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090701/0ad891e8/attachment.html
More information about the gradsusr
mailing list