[cairo] cairo anti aliasing

Øyvind Kolås islewind at gmail.com
Sun Feb 20 10:57:03 PST 2005


On Sat, 19 Feb 2005 16:45:52 +0100 (CET), Tim Janik <timj at gtk.org> wrote:
> no, the result is different. i've attached a new image. the left rectangle
> is rotated by 12.5 degrees with a feather edge of 3 pixels applied before
> rotation. the right rectangle is rotated by 12.5 degrees and a gaussian
> blur (3x3 matrix) applied after rotation.
> edges in the right rectangle still contain step artefacts from the rotation,
> just blurred, while edges in the left rectangle are properly anti-aliased.

Cairo's anti aliasing is achieved by calculating the amount of each
component within a square (usually referred to as a "square" pixel)
surrounding the coordinates of the sample point. This kind of sampling
filter is called a box filter. And is the correct sampling given an
LCD display, and linear light, most web browsers etc. assume the RGB
values to be non linear light, (thus you might want to gamma adjust
the data cairo returns).

For a CRT monitor a more expensive sampling operations, either based
on a gaussian integral centered on the sampling point would probably
be more correct, but give an unreasonably blurry result on an LCD
display.

So if it is control over the anti aliasing that is needed,.
compensating for gamma might be part of the solution. Blur/Low pass
filtering is bound to make the shapes drawn less precisely.

/Øyvind K.

-- 
Software patents hinder progress | http://swpat.ffii.org/ 
Web :  http://pippin.gimp.org/



More information about the cairo mailing list