[cairo] cairo anti aliasing
Nathan Hurst
njh at hawthorn.csse.monash.edu.au
Mon Feb 28 14:20:40 PST 2005
On Mon, 28 Feb 2005, Bill Spitzak wrote:
> exact definition of blurring the image by a 2D filter. Blurring will *not*
> remove aliasing artifacts. If you have a stairstep shape, you will get a
> blurry stairstep. You even posted images showing this. The fact that if you
> blur it a *lot* it gets hard to see the steps is irrelevant. Your Gimp
> examples are nowhere near blurry enough to be demonstrating this.
If you are point sampling the original shape then you will get
antialiasing. That seems to be where the confusion is: sure, blurring
(with convolution or fft or whatever) a one-test per pixel drawn polygon
will no remove the aliasing until the high pass cut off is greater than 1
pixel; but that ain't antialiasing. So forget about post blurring, it's
not really relevant.
On the other hand, point sampling the original distribution (the infinite
precision polygon) with any approach will be a form of antialiasing. The
simplest would be a single sample for each pixel (resulting in quite poor
antialiasing behaviour), more advanced systems use box sampling, or even
taking from an appropriate distribution for the display technology and eye
response - say circular gaussian for crt, horizontally stretched gaussian
for lcd. TJ seems to want to sample a wider distribution than a single
pixel. This seems a reasonable thing to want to do, the question is
whether it belongs in cairo?
I would argue yes, but only if someone is willing to code for it. It will
probably be costly performance wise, but can lie in its own code path
(perhaps a separate backend?).
njh
p.s. you can also antialias with integrals - computing pixel coverage or
even performing area integrals of your distribution of choice, but these
tend to be harder to get right.
More information about the cairo
mailing list