On Tue, Oct 19, 2010 at 3:57 PM, Jofre Janué <span dir="ltr"><<a href="mailto:jjanue@hotmail.com">jjanue@hotmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Sorry, I repeat the question with the correct subject:<br>
<br>
I am new and for this reason I d'ont know if you have talked about it, but<br>
any way, Does anybody knows how can we print an alpha chanal image file from<br>
GrADS?<br></blockquote><div><br></div><div>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. </div>
<div><br></div><div> The relevant command here is <b>set_rgba</b> 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.</div>
<div><br></div><div> Arlindo</div><div><br></div><div><div>NAME</div><div> set_rgba - define color including alpha channel</div><div><br></div><div>SYNOPSIS</div><div> set_rgba color red green blue alpha [mask]</div>
<div><br></div><div>DESCRIPTION</div><div> This User Defined Command (UDC) defines *color* given its</div><div> RGB triplet along with its *alpha* channel.</div><div><br></div><div> color integer in the range [16-255]</div>
<div> red, </div><div> green,</div><div> blue integers in the range [0-255]</div><div> alpha float, with alpha ranging from 0.0 (fully transparent)</div><div> to 1.0 (fully opaque).</div><div>
<br></div><div> The optional parameter *mask* determines whether the color below</div><div> it is visible or not.</div><div><br></div><div> mask=0 --- if alpha<1, *color* will be semi-transparent and the</div>
<div> colors below it will be visible (default)</div><div> mask=1 --- if alpha<1, *color* will be semi-transparent but the</div><div> colors below it will *not* be visible </div><div><br>
</div><div>EXAMPLE</div><div> In order to emulate the -t option in printim </div><div><br></div><div> ga-> set rgb 60 125 125 125</div><div> ga-> printim img.png -t 60</div><div><br></div><div> Specify alpha=0 and mask=1</div>
<div><br></div><div> ga-> set_rgba 60 125 125 125 0 1</div><div> ga-> gxyat img.png</div><div><br></div></div><div><br></div><div><br></div></div>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>