[Bf-codereview] Alpha premul pipeline cleanup (issue 7018048)

Xavier Thomas xavier.thomas.1980 at gmail.com
Sun Dec 30 00:06:56 CET 2012


The double can come from the painting too.

If you paint on an fully transparant image, what would be the background
without taking alpha into consideration?
Black I suppose (If white than the problem would be present when painting
black)
Now you paint white on it with a brush with soft-edges.
If the painting code mix the white (the color you are painting with) with
the black (the supposed background color that we cannot see) on the edges
of the brush.
Than you premultiply for display -> blak border.

The painting code should paint full white even on the border of the brush
and should not blend the painting color with the background, but this only
when painting on area that where fully transparant befor painting. For
areas that where opaque already before painting the  blend should occur.
But for it to work properly in any case -> the painting code should be
modifed and take the "old" alpha value into account for modifying colors.

That's where I think the problem comes from anyway.


2012/12/29 Xavier Thomas <xavier.thomas.1980 at gmail.com>

>
> However, byte buffers behaves quite fuzzy. When i do a stroke with white
>> brush on complete transparent image, i should see the whole stroke being
>> white in RGB display mode, but it fades up to darkish colors to the
>> sides of brush. Converting pixels from straight-byte to premul-float in
>> IMB_rectblend and using IMB_blend_color_float doesn't give correct
>> result here.
>
>
> Darkish colors in the semitransparent areas is often a sign of having
> premultiplied colors by alpha twice or more.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-codereview/attachments/20121229/bee12818/attachment-0001.htm 


More information about the Bf-codereview mailing list