[cairo] Premultiplied transparency causes streaks in images

Paril paril at alteredsoftworks.com
Fri Nov 12 18:16:06 PST 2010


Thanks guys.

I appreciate the responses, but I just couldn't deal with the API any
longer.

I moved over to a game-based engine called Gorgon, which is based upon
Direct3D/Direct2D. It works very well for blitting transparency onto the
surfaces, and it runs INCREDIBLY fast due to hardware acceleration.
Unfortunately, SlimDX is a pain in the ass to distribute, but it's the best
option I got! It also works solely on floating point values for one of these
very reasons.

Again, thanks you guys, Andrea, for taking the time to respond and try to
solve my issue.

-P

On Fri, Nov 12, 2010 at 5:57 PM, Bill Spitzak <spitzak at gmail.com> wrote:

> I don't think there is any way around having to use another buffer for the
> brush stroke.
>
> However using MIN (or MAX if the brush is 0 in the transparent areas and 1
> where opaque) would be a way to create this buffer from an antialiased or
> partially-transparent brush at the same resolution as the final image. There
> is no need for the super-sampling I suggested.
>
>
> M Joonas Pihlaja wrote:
>
>> 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
>>
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20101112/d828e65c/attachment.html>


More information about the cairo mailing list