[cairo] White seams (lines) appearing between objects

Carl Worth cworth at cworth.org
Mon Jan 14 10:14:36 PST 2008


On Mon, 14 Jan 2008 9:33:10 -0800, MenTaLguY wrote:
> On Mon, 14 Jan 2008 16:03:19 +0100, Kristof Van Landschoot <kristof at coin-c.com> wrote:
> >
> > Is there anything we can do about this?

This is a known effect do to the way cairo computes antialiasing
incrementally, (for each drawing operation). There are various
workarounds. Some people would rather see a full-scene-antialiasing
(FSAA) mode built into cairo, but that doesn't exist yet.

> The simplest solution is to render without antialiasing and then decimate
> the output with an NxN averaging filter to get an antialiased result[1].

So that would be turning off cairo's antialiasing, and implementing
your own FSAA. It's certainly possible to do. It will be up to you
whether that's worth it or not.

> In the general case, the fringing is impossible to avoid when using
> "incremental" antialiasing.  In some specific cases, you can use the
> SATURATE compositing mode, but it only works when the shapes are entirely
> opaque and/or do not actually overlap anywhere.

I don't think that's necessarily true. Using SATURATE, (which does
require a scene that is strictly 2.5-dimensional[*] and also drawing
in a front-to-back order), should allow you to avoid seams even with
translucent, overlapping objects. Now, the results might not match
identically with what you would get with the OVER operator, so maybe
that's what you meant by suggesting it doesn't work.

There are other workarounds that are most easily applied in certain
specific situations, but perhaps not in general. Some of these include
"don't use geometry with shared edges" and other tricks such as
slicing up objects and re-assembling the same-colored portions with a
seam-free operator such as ADD.

There are various, (sometimes long), discussions about this in several
old threads of the cairo mailing-list archives. Use the search box
here:

	http://lists.cairographics.org/archives/cairo/

with the word "seams" for example.

I hope that helps. And I hope you can have lots of fun with cairo.

-Carl

[*] By 2.5 dimensional I mean that you cannot have to objects that
mutually overlap each other.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080114/024d1697/attachment.pgp 


More information about the cairo mailing list