[cairo] cairo anti aliasing

Tim Janik timj at gtk.org
Sun Feb 20 11:09:55 PST 2005


On Sun, 20 Feb 2005, Øyvind Kolås wrote:

> 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).

ah, thanks. you got a pointer into the source as to where
exactly this is implemented?

> 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.

yeah, a gaussian integral centered on the sampling point is essentially
what i've been using in my rendering routines so far and is what i'd
like to see implemented in cairo as well.

---
ciaoTJ


More information about the cairo mailing list