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

Xavier Thomas xavier.thomas.1980 at gmail.com
Sun Dec 30 04:24:07 CET 2012


Hi,

I made some tests and read most of the painting code but did not had time
to code a fix yet.

Here are my finding so far.

Create an new image in the uv/image editor (opaque black)
Paint the lower half of the image in white (still no alpha)
Use the "Erase Alpha" paint mode to make the whole image transparent.

--> In the view (RGB whit no alpha) it displays all black, the white and
transparant part of the image is lost.
This makes me think that even the image is byte with straight colors, not
colormanged  and need to be displayed with straight colors it is somehow
modified.

Then painting white or black stroke over the image works ok, or not
depending if you paint white on white or white on black or the other way
around.

Images are better than a 1000 words:

http://www.pasteall.org/pic/42616
http://www.pasteall.org/pic/42617


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

> I am patching now, but I cannot promess I will have time to debug :(
>
>
> 2012/12/29 <sergey.vfx at gmail.com>
>
> On 2012/12/29 22:41:44, xavier.thomas.1980_gmail.com wrote:
>>
>>> > 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.
>>>
>>
>> I know this and it doesn't seem to be this case. If you'll try the patch
>> you'll notice that blending is much more "steppy" than just multiplying
>> alpha twice. It could be extra premul, but there seems to be some other
>> issue involved here.
>>
>> https://codereview.appspot.**com/7018048/<https://codereview.appspot.com/7018048/>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-codereview/attachments/20121230/0e0f1d3b/attachment.htm 


More information about the Bf-codereview mailing list