This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Transparency mask

Tags: None
(comma "," separated)
canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Mon Apr 16, 2012 5:45 pm
Do you mean using erase rather than black?

May you suggest a way of converting an image to a selection based on a full spectrum of the greyscale values.
User avatar
Animtim
Registered Member
Posts
259
Karma
0
OS

Re: Transparency mask

Mon Apr 16, 2012 6:16 pm
canaldin wrote:May you suggest a way of converting an image to a selection based on a full spectrum of the greyscale values.


To do such thing, I'd do:
-Convert your image/layer to grayscale (use desaturate, or convert layer to grayscale…)
-Use "Color to Alpha" filter" and select pure white or black depending on what you want, with threshold=100
-Now do "Select opaque" on the resulting layer, and with this selection activated now create the transparency mask you want.
canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Mon Apr 16, 2012 6:44 pm
Nice workaround. worked perfectly
it also works the other way as I tried to come back from a mask to selection, it almost froze my computer but anyway, thank you for the advice
canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Mon Apr 16, 2012 7:27 pm
Actually, it is not correct.

I was trying to make a test scene and something wasn't working quite right. So I thought to check it. I made just a flat gradient, copied the layer and inverted it, than I applied your procedure. the result was a two sided gradient with a grey area in the middle instead of a pure black(or white).

This could mean that when converting colour to alpha Krtia doesn't take into account the colour space. I was working in 8bit sRGB, so probably Krita made a linear conversion neglecting the gamma shift of the sRGB. May this be a valid hypothesis?

original file: http://www.mediafire.com/?9uotc5743oidbdu

correction: the top layer should be put to multiply, sorry for the error, and still it results in a grey band in the middle.
User avatar
Animtim
Registered Member
Posts
259
Karma
0
OS

Re: Transparency mask

Mon Apr 16, 2012 8:26 pm
Ok, I've tested your file and I see what you mean…
The problem is not in the inverted layer as if you set it to "Inverse substract" blending mode the result is pure black as expected.

So the problem is that "Color to Alpha" doesn't do exactly value to alpha in this case, like the operation it uses is not correct for this at least. So it's a poor workaround in this case… the few times I've used it this way it was precise enough for my usecase, but here I see the limit.

And the "Select from color range" option doesn't help as it can't do this with current options.

Good catch!
canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Mon Apr 16, 2012 9:15 pm
You're right multiplication should give grey in the middle as it is multiplying 0,5 x 0,5 = 0.25.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Transparency mask

Tue Apr 17, 2012 5:53 am
Sounds like we need a couple of bug reports :-)
cson
Registered Member
Posts
8
Karma
0

Re: Transparency mask

Wed Apr 18, 2012 3:47 am
canaldin wrote:Do you mean using erase rather than black?

sometimes i perfer to use the combination of layer group and erase than the mask
for example it can do multi layer masking & chech the erase layer by change back to normal mode (i dont know how to do this with the mask layer)
& and i feel intuitively of the Mask above the layer (or along side) than below it due to i do the masking later


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], markhm, rblackwell, sethaaaa, Sogou [Bot], Yahoo [Bot]