[gradsusr] Alpha channel

Arlindo da Silva dasilva at alum.mit.edu
Wed Oct 20 21:38:02 EDT 2010


On Tue, Oct 19, 2010 at 3:57 PM, Jofre Janué <jjanue at hotmail.com> wrote:

>
>  Sorry, I repeat the question with the correct subject:
>
> I am new and for this reason I d'ont know if you have talked about it, but
> any way, Does anybody knows how can we print an alpha chanal image file
> from
> GrADS?
>

Alpha channels are only supported with the gxyat extension that comes with
the opengrads bundle. You will not see the transparency on the screen when
you create a png image with gxyat it will be there. Gxyat is based on cairo,
a rendering library that COLA is currently considering for GrADS.

   The relevant command here is *set_rgba* which works pretty much like "set
rgb" but you now specify 4 numbers, the last one being the alpha channel
(transparency) associated with the color you define. The man page for
set_rgba follows.

    Arlindo

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/20101020/71ab67dd/attachment-0003.html 


More information about the gradsusr mailing list