Re: Applying to a surface the alpha of other

Carlos López González <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAF52pzK0dMCNQP+DE+4xom7JoncRqaOnC5WP2w-49BKWn1asmg@mail.gmail.com>
Hi,
unfortunately the proposed solution doesn't work. When a ARGB32 color
is painted in a RGB24 surface, the colors are multiplied by the alpha.
Say I have a ARGB color:
ARGB(0.8, 1.0, 0.5, 0.5)
once painted to a RGB24 surface it becomes:
RGB(0.8, 0.4, 0.4)

Later if I mask back this color thru a 0.6 alpha mask, then it keeps
the RGB values and keeps the alpha but the colors are washed out:

ARGB(0.6, 0.8, 0.4, 0.4)

When my desired result is
ARGB(0.6, 1.0, 0.5, 0.5) that is keep the colors of one surface and
apply the alpha of other.

Any other idea?


2012/10/16 Carlos López González <[email protected]>:
>>> Then basically the question is: How do I change the alpha channel of
>>> all the pixels to be 1.0?
>>
>> How about painting it to an RGB24 surface (with operator source)?
>>
>> Uli
>
> Ah great idea! I'll give it a try and let you know.
> Thanks!
> Cheers
>
> --
> Carlos
> http://synfig.org



-- 
Carlos
http://synfig.org
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.