[gradsusr] GXyat question re. colours
Jennifer Adams
jma at cola.iges.org
Fri Sep 30 18:33:14 EDT 2011
I had remembered it backwards ... it's been so long since I have
worked on anything cairo-related... anti-aliasing must be DISABLED for
polygon fills. These are screen shots from the X11 rendering, not
output from gxyat.
Here is a 'gxout shade2' plot drawn with anti-aliased polygon fills:
and here is the same thing with anti-aliasing disabled for polygon
fills:
--Jennifer
On Sep 22, 2011, at 7:37 PM, Arlindo da Silva wrote:
> On Thu, Sep 22, 2011 at 1:56 PM, Jennifer Adams <jma at cola.iges.org>
> wrote:
> 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 'snap' them to the pixel
> grid and then they won'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't
> recommend that.
>
> I'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:
>
> http://portal.nccs.nasa.gov/cgi-hs3/hs3_wx.cgi?region=hs3&dtg=2011092212&prod=1ht&model=fp&level=300&tau=000&®ion_old=hs3&dtg_old=2011092212&prod_old=1ht&model_old=fp&level_old=200&tau_old=000&&loop=0
>
> Do you have an example where this problem is apparent?
>
> Thanks,
>
> Arlindo
>
>
>
> 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.
> --Jennifer
>
>
>
> On Sep 22, 2011, at 11:51 AM, Arlindo da Silva wrote:
>
>> On Thu, Sep 22, 2011 at 4:25 AM, Becker, Bernd <bernd.becker at metoffice.gov.uk
>> > wrote:
>> Arlindo,
>>
>> you are right, this is an artifact of antialiasing
>> (see attached plot: the yellows are the same in contour and in
>> legend box)
>>
>> So we found the cause.
>>
>> But the plot looks no where near as impressive as the previous
>> output from gxyat.
>>
>> What can we try to do about that?
>>
>> Anti-aliasing is a perceptual approximation that achieves "smooth
>> lines" by blending pixels with the "environment"; 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.
>>
>> Arlindo
>>
>>
>>
>> Cheers,
>> Bernd.
>>
>>
>>
>> --
>> Bernd Becker Climate Impacts Product Development
>> Met Office Hadley Centre FitzRoy Road Exeter Devon EX1 3PB
>> United Kingdom
>> Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050
>> E-mail:bernd.becker at metoffice.gov.uk - http://www.metoffice.gov.uk/research/our-scientists/seasonal-to-decadal/bernd-becker
>>
>> http://www.metoffice.gov.uk/news/releases/archive/2011/weather-game
>>
>>
>>
>> From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org
>> ] On Behalf Of Arlindo da Silva
>> Sent: 22 September 2011 03:10
>> To: GrADS Users Forum
>> Subject: Re: [gradsusr] GXyat question re. colours
>>
>> On Wed, Sep 21, 2011 at 7:02 AM, Becker, Bernd <bernd.becker at metoffice.gov.uk
>> > wrote:
>>
>> Hello,
>>
>> How can I force gxyat to save the colours to a gif file as
>> displayed on
>> screen ?
>>
>> Please find attached 2 images,
>> one created with printim (authentic colours) and one
>> created with gxyat and observe, that the yellow in the contour plot
>> differs from the
>> yellow in the legend.
>>
>> What could be the cause of that?
>>
>> What can I do about it?
>>
>>
>> This is strange. Possibly this is an artifact of anti-aliasing.
>> Could you try turning anti-aliasing off?
>>
>> ga-> gxyat +a file.png
>>
>> Arlindo
>>
>>
>> --
>> Arlindo da Silva
>> dasilva at alum.mit.edu
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>>
>>
>> --
>> Arlindo da Silva
>> dasilva at alum.mit.edu
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>
> --
> Jennifer M. Adams
> IGES/COLA
> 4041 Powder Mill Road, Suite 302
> Calverton, MD 20705
> jma at cola.iges.org
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
>
> --
> Arlindo da Silva
> dasilva at alum.mit.edu
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110930/fc8e8162/attachment-0003.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sampleaa.png
Type: image/png
Size: 65471 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110930/fc8e8162/attachment-0006.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.png
Type: image/png
Size: 42389 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110930/fc8e8162/attachment-0007.png
More information about the gradsusr
mailing list