On Thu, Sep 22, 2011 at 1:56 PM, Jennifer Adams <span dir="ltr">&lt;<a href="mailto:jma@cola.iges.org" target="_blank">jma@cola.iges.org</a>&gt;</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">

<div style="word-wrap:break-word">The anti-aliasing in the Cairo library does make the colors seem a little duller than when drawing without anti-aliasing. There is no real cure for this, although if you increase the thickness of the anti-aliased lines, they do brighten. For lines that we know will be exactly horizontal or vertical, we plan to &#39;snap&#39; them to the pixel grid and then they won&#39;t be drawn with the anti-alias blending on the edges. This will make the plot frame and other rectangles look sharp and bright. Turning off anti-aliasing for polygon fills results in very faint gaps that are visible between adjacent polygons of the same color (e.g. in a shaded plot), so I don&#39;t recommend that.</div>

</blockquote><div><br></div><div>I&#39;ve been doing this for some time in gxyat and I never saw this artifact.  Here is a typical plot with plenty of same color polygons:</div><div><br></div><div><a href="http://portal.nccs.nasa.gov/cgi-hs3/hs3_wx.cgi?region=hs3&amp;dtg=2011092212&amp;prod=1ht&amp;model=fp&amp;level=300&amp;tau=000&amp;&amp;region_old=hs3&amp;dtg_old=2011092212&amp;prod_old=1ht&amp;model_old=fp&amp;level_old=200&amp;tau_old=000&amp;&amp;loop=0">http://portal.nccs.nasa.gov/cgi-hs3/hs3_wx.cgi?region=hs3&amp;dtg=2011092212&amp;prod=1ht&amp;model=fp&amp;level=300&amp;tau=000&amp;&amp;region_old=hs3&amp;dtg_old=2011092212&amp;prod_old=1ht&amp;model_old=fp&amp;level_old=200&amp;tau_old=000&amp;&amp;loop=0</a></div>
<div><br></div><div>Do you have an example where this problem is apparent?</div><div><br></div><div>   Thanks,</div><div><br></div><div>       Arlindo</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"> A possible solution is to draw the perimeter of each polygon to cover the gaps, but this is a performance hit. We are still thinking about the user interface to control all these factors. For using gxyat right now, I would try tweaking the line thickness and the size of your output image, those things may improve the appearance/dimness of the anti-aliased lines. <div>

--Jennifer<br><div><div><br></div><div><br><div><div><div></div><div><br><div><div>On Sep 22, 2011, at 11:51 AM, Arlindo da Silva wrote:</div><br><blockquote type="cite">On Thu, Sep 22, 2011 at 4:25 AM, Becker, Bernd <span dir="ltr">&lt;<a href="mailto:bernd.becker@metoffice.gov.uk" target="_blank">bernd.becker@metoffice.gov.uk</a>&gt;</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"> <u></u> <div> <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial">Arlindo,</font></span></div>

 <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial"></font></span> </div> <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial">you are right, this is an artifact of antialiasing</font></span></div>

 <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial">(see attached plot: the yellows are the same in contour and in legend box)</font></span></div> <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial"></font></span> </div>

 <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial">So we found the cause.</font></span></div> <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial"></font></span> </div>

 <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial">But the plot looks no where near as impressive as the previous output from gxyat.</font></span></div> <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial"></font></span> </div>

 <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial">What can we try to do about that?</font></span></div> <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial"></font></span></div>

</div></blockquote><div><br></div><div>Anti-aliasing is a perceptual approximation that achieves &quot;smooth lines&quot; by blending pixels with the &quot;environment&quot;; it is all handled by the cairo library.  I am not entirely sure why the legend gives you a different color... but wait a minute!  One trick that gxyat uses to avoid those funny lines in filled  contours is to turn anti-alising off every time a (filled) polygon is drawn. How are you creating your legend? Try using the more basic line to, move to function instead of a polygon function; this way you will have the same anti-aliasing used by the contour lines.</div>

 <div><br></div><div>   Arlindo</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial">Cheers,</font></span></div>

 <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial">Bernd.</font></span></div> <div dir="ltr" align="left"><span><font color="#0000ff" size="2" face="Arial"></font></span> </div> <div><font color="#0000ff" size="2" face="Arial"></font> </div>

<div><font size="2"></font><br></div><div><font size="2">--<br>Bernd Becker   Climate Impacts Product Development<br>Met Office Hadley Centre    FitzRoy Road  Exeter   Devon EX1 3PB  United Kingdom<br>Tel.: <a href="tel:%2B44%20%280%29%201392%20884511" value="+441392884511" target="_blank">+44 (0) 1392 884511</a> Fax: <a href="tel:%2B44%20%280%29870%20900%205050" value="+448709005050" target="_blank">+44 (0)870 900 5050</a><br>

</font></div><font size="2"><a href="mailto:E-mail%3Abernd.becker@metoffice.gov.uk" target="_blank">E-mail:bernd.becker@metoffice.gov.uk</a> - <a href="http://www.metoffice.gov.uk/research/our-scientists/seasonal-to-decadal/bernd-becker" target="_blank">http://www.metoffice.gov.uk/research/our-scientists/seasonal-to-decadal/bernd-becker</a><div>

 <br><a href="http://www.metoffice.gov.uk/news/releases/archive/2011/weather-game" target="_blank">http://www.metoffice.gov.uk/news/releases/archive/2011/weather-game</a><br></div></font><div><br></div> <div> </div><br> <div dir="ltr" lang="en-us" align="left">

 <hr> <font size="2" face="Tahoma"><b>From:</b> <a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a> [mailto:<a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a>] <b>On Behalf Of </b>Arlindo da Silva<br>

<b>Sent:</b> 22 September 2011 03:10<br><b>To:</b> GrADS Users Forum<br><b>Subject:</b> Re: [gradsusr] GXyat question re. colours<br></font><br></div><div><div></div><div> <div></div>On Wed, Sep 21, 2011 at 7:02 AM, Becker, Bernd <span dir="ltr">&lt;<a href="mailto:bernd.becker@metoffice.gov.uk" target="_blank">bernd.becker@metoffice.gov.uk</a>&gt;</span> wrote:<br>

 <div class="gmail_quote"> <blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote"><br>Hello,<br><br>How can I force gxyat to save the colours   to a gif file as displayed on<br>

screen ?<br><br>Please find attached 2   images,<br>one created with printim (authentic colours) and one<br>created   with gxyat and observe, that the yellow in the contour plot<br>differs from   the<br>yellow in the legend.<br>

<br>What could be the cause of   that?<br><br>What can I do about it?<br><br></blockquote> <div><br></div> <div>This is strange. Possibly this is an artifact of anti-aliasing. Could you try turning anti-aliasing off?</div>

 <div><br></div> <div>ga-&gt; gxyat +a file.png</div> <div><br></div> <div>    Arlindo</div> <div><br></div> <div> </div></div>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu" target="_blank">dasilva@alum.mit.edu</a><br>

</div></div></div> <br>_______________________________________________<br> gradsusr mailing list<br> <a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>

 <br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu" target="_blank">dasilva@alum.mit.edu</a><br> _______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></blockquote>

</div><br></div></div><font color="#888888"><div> <span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>

--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org" target="_blank">jma@cola.iges.org</a></div><div><br>

</div><br></span></span></div></span> </div><br></font></div></div></div></div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu" target="_blank">dasilva@alum.mit.edu</a><br>