[cairo] cairo anti aliasing

Owen Taylor otaylor at redhat.com
Sun Feb 20 13:03:40 PST 2005


Tim Janik wrote:
> On Fri, 18 Feb 2005, Carl Worth wrote:
> 
>> On Sat, 19 Feb 2005 00:38:07 +0100 (CET), Tim Janik wrote:
>>
>>> adjusting the amount of anti-aliasing:
>>>    currently, i can render rectangles with varying amounts of 
>>> smoothness at
>>>    the edges, similar to the "Feather Edge" feature of the gimp 
>>> "rectangle
>>>    select" command. this is essentially adjusting the radius of a 2D 
>>> gaussian
>>>    curve in pixels, used to smooth the figure edges.
>>>    as an example, i have attached an image, containing 4 times the same
>>>    rectangle, rendered with feather edges of 0, 1, 2 and 3 from left 
>>> to right.
>>
>>
>> Would you be satisfied here with an operation for applying some filter
>> to an image, (eg. a Gaussian or some other convolution kernel)?
>  
> 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.

I think if you filter a properly antaliased rotated rectangle you'll get
better results than that. You can't substitute filtering for
antialiasing. (Well, unless you render at a higher resolution and
scale down when filtering. Which is essentially what antialiasing
is.)

Image below on left is rotated rectangle drawn with Cairo, image on 
right is that same image filtered (radius 1.5 guassian blur
in the GIMP).  The steps in your image don't appear.

Regards,
							Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotate-rect.png
Type: image/png
Size: 4370 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050220/8d4ef80a/rotate-rect.png


More information about the cairo mailing list