[cairo] Premultiplied transparency causes streaks in images

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Fri Nov 12 12:09:26 PST 2010


On Fri, 12 Nov 2010, Bill Spitzak wrote:

> The real solution is to somehow figure out the exact antialiasing of the
> entire brush stroke. I think modern programs just do this by making a much
> bigger "stroke buffer" where the a much larger aliased brush draws opaque,

If you could composite the brush using MIN() on the alpha component,
then you could generate a mask that preserves the antialiasing
reasonably but afaict, there's no easy way to do this using pure cairo
calls.  Andrea Canciani suggested using the new DARKEN operator to
create a greyscale version of the mask (implements MIN() on the colour
components, but sadly not alpha) and then converting that to an A8
mask.

Joonas


More information about the cairo mailing list