Transparency, opacity, mask editing (was: A first part of the layers/masks patch)

Matthew Woehlke mw_triad at users.sourceforge.net
Mon Sep 28 19:18:40 CEST 2009


Cyrille Berger wrote:
> On Saturday 26 September 2009, Dmitry Kazakov wrote:
>> On Sat, Sep 26, 2009 at 10:14 AM, Cyrille Berger <cberger at cberger.net>wrote:
>>> On Saturday 26 September 2009, Dmitry Kazakov wrote:
>>>>> for a,b,c) it doesn't work perfectly, but it's not that broken.
>>>> But still not usable =(
>>> Well now, I have fix all the issue with the alpha colorspace (I have
>>> added alpha darken). All it remains to do is to make mask support the
>>> indirect painting interface.
>> Well, no. You've not fixed that. It's just a workaround.
>>
>> Testcase:
>> 1) Create any mask (e.g. transparency mask)
>> 2) Paint something on a mask to get transparency
>>
>> Let's imagine after these steps you decide to make some rect visible again,
>> what are you going to do? In a good editor you just select this rect with
>> selection and fill it with a white color (or any semi-transparent one(!)).
> Why white ?

White, in grayscale, has high value (255 if we're talking 8-bit). 
Traditionally, 0 = transparent, high = opaque.

I haven't played with it as much recently, but usual way (e.g. gimp, PS, 
I think painter) is, layer is RGBA and you can also have separate alpha 
mask.

When painting, usually you have RGB brush with fixed max alpha (i.e. 
fully opaque), except eraser tool which has fixed alpha 0 and doesn't 
change other channels. So for Krita, having alpha channel of color, you 
can choose what alpha you paint. Note that you still have separate 
opacity that controls how much the brush 'overwrites' the existing pixels!

The down side is this makes gradients/fills work different from all 
other editors, because painting with fill that has alpha 0 will fully 
overwrite color /and alpha/. Maybe it is a good idea to have a paint 
option to map alpha to opacity instead (and treat alpha as always max).

TBH, painting with a color that makes more transparent seems a little 
odd in a real-world sense, which is maybe why no other editor I know of 
uses such a system. And TBH if we are trying to imitate real media, I 
would question the wisdom of such a decision.

Back on the subject of alpha masks...

Alpha mask is treated as grayscale, no alpha of its own, and layer alpha 
channel is multiplied by mask to get actual alpha used for blending. If 
you set brush alpha here, that is always multiplied into opacity.

-- 
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
-- 
No .sig today. Come back tomorrow.
(paraphrased German saying)



More information about the kimageshop mailing list