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

Transparency mask

Sun Apr 08, 2012 9:48 am
Hello
I'm a new krita user. I'm trying to switch from win7 to a purely linux based workflow.

I wondered If there are plans of gatting the transpareny mask to work as in other softwares like gimp and photoshop.

The fact that a selection equals a grayscale bitmap and viceversa that the grayscale bitmap equals a selection is a core paradigm of non destructive editing. For smeone like me that used to mess around with brushes and palettes finding out that there is a mathematical logic behind color and transparencies was just mindblowing. I personally think that using eraser tool to provide balck alpha values is just misleading for anyone who may want to understand at some point the basics of compositing which is still an essental part of digital painting.

A possible solution: cosider mask as a black&white channel and peserve the option to draw with an eraser which would equal to an always black brush. This way one could easily make masks by filling manual and procedural selections(made using color range or rgb channel values)

I know that krita turned it's back to photographers and faced a more specific public of illustrators. But I think that nowdays it has such a powerful toolset and vitually no serious alternative(from the gimp related projects) that it is a real pity that it deliberately excludes concern for phtographic and compositing work.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Transparency mask

Sun Apr 08, 2012 10:01 am
Yes, I tried really hard to fix that for 2.4, but failed. There are two issues here: Krita really assumes that everything you can paint on will always have an alpha channel, otherwise painting won't work. That makes it impossible to have a gray channel-only mask we can paint on. The other is that a selection always only has an alpha channel. That makes it impossible to just use gray+alpha for a mask, since a mask is just a selection.

These assumptions are so deep-seated in Krita that despite more than a month of work I couldn't get it working correctly. But the issue is still on the radar, and I am still working on it.

I've also got a branch where I'm working on what I'm calling a channel mixer -- a way to decompose layers into channels and masks and recompose them in various ways. Work on that stopped when I went to work on grayscale masks...
canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Sun Apr 08, 2012 10:09 am
I'm so glad hearing that this issue is being adressed.

I'd like to help, but I think that the best I can do is to post some tutorials about using transparency masks once they work properly as I don't have a stable income to contibute financially to the project :)
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Transparency mask

Sun Apr 08, 2012 10:12 am
Tutorials rock! We really need those :-).
canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Sat Apr 14, 2012 12:40 am
Just got thinking about your reply. I think you're right a more unconstrained layer and channel handling could be a great move. It would also make krita suitable for basic compositing work e.g to create textures. :)

The way I suppose it should work is that the alpha channel of the RGBA that constitutes a layer should have a small 3 step pipeline.

R..G..B..A
.............X
Transparency mask
.............X
Shape Mask

On the bottom the rasterized shape mask(if present) which is multiplied by the layer mask(transparency mask) (if present) and in the end be multiplied by the alpha channel of the RGBA bitmap.

It seems that as for now the transparency mask just passes it's alpha information to the main RGBA alpha. And it's RGB components are locked.

If RGB components where unlocked than, staying true that everyting should be RGBA in krita you could convert RGBA to black and white and fetch it into the main alpha channel, as does blender. Blender compositing nodes also assume that evry image has an alpha channel I made a small exemple http://www.pasteall.org/pic/show.php?id=30098 (maybe redundant)
Probably in photoshop masks are regarded as a kind of sub-channel as you cannot paste directly into a mask, you can only use selections of color channels or their composites to generate a mask. Actually if RGB channels of a krita mask where unlocked it wuold be much cooler than photoshop because at that point you could paste an RGBA image directly into the mask which in photoshop is impossible.

It is always hard to speak for a non programmer as this message may result annoying, feel free to ignore it if it does :)

Thank you

Last edited by canaldin on Mon Apr 16, 2012 6:17 pm, edited 1 time in total.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Transparency mask

Sat Apr 14, 2012 8:10 am
Nope, not annoying at all, on the contrary, welcome! I need to think on it, though :-)
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS

Re: Transparency mask

Sat Apr 14, 2012 10:53 am
I wanted to dive in trying to replicate the screenshot posted by canaldin ( http://www.pasteall.org/pic/show.php?id=30098 ) to perfect my knowledge of Krita layer stack and compositing.

[1]- here a first test , the most straight forward :
Image
Full img : http://wstaw.org/m/2012/04/14/20120414_ ... hot_13.jpg
Test file (*.kra) : http://david.revoy.free.fr/forums/krita ... _test1.kra
Note : it was a bit hard to 'paint' a mask from a limited shape like this big 'A' , I had to : 1-create the layer with the 'A' container, 2- Create on the 'RGBA' a transparency mask , 3- On the 'A' layer select from opaque, 4- Invert selection, 5- select the transparency mask and press del. Done. What I couldn't do is simply fill a selection on a transparency mask, or paint inside a selection in a transparency mask. But 'delete' respect erasing selection on a transparency mask, so I used this way.

[2]- here another test ( assuming using a background texture ) , and trying to use the second alpha icons :
Image
Full img : http://wstaw.org/m/2012/04/14/20120414_ ... hot_12.jpg
Test file (*.kra) : http://david.revoy.free.fr/forums/krita ... a_test.kra
Note : I see it's easier with the second alpha icon checked ( layer stack, the 'alpha' symbol ) on the 'RGBA' layer to define his transparency sort of children of the big 'A' container one. All of this in a group of course. What I couldn't do with this test, is to find a way to make the 'A' container itself full transparent.

Here is my test. I learned .Hope they can be useful, that's why I posted them here.


canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Sat Apr 14, 2012 10:58 am
I supose it is because the mask is not multiplied by the alpha channel of the RGBA
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS

Re: Transparency mask

Sat Apr 14, 2012 11:57 am
With the 1st method [1]- , it is.

Not with the second method [2]-.


canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Sat Apr 14, 2012 2:14 pm
I tried the first method and it is doable. But note that in the pasteall image from blender I purpusefully made the big A slightly grey, so that when it gets multiplied by the alpha channel from the RGBA image it results in a little transparent shape, you may note that the upper image slightly reveals the checker pattern. My consideration was about the fact that speaking of greyscale values instead of erease-paint would provide a more straightforward approach. I think that digital painters could greatly benefit from it. You probably know it better than I do. Because as I saw from people doing painting, many times they sample, copy and distort various textures(mostly grunge) and blend them extensively throughout their workflow by using overlay and other blending modes but also using transperency masks. Those are usually made from converting color channels to selections, using color range or other selection methods such as path. Other times those are manually painted with normal or textured brush. In my case, working in photoshop I'm never scared of losing a complex selection because I know that I can always store it as a greyscale mask and subsequently restore it as a selection with a simple command.

I just found this page concerning our argument http://community.kde.org/Krita/Grayscale_Selections_Discussion_Notes
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Transparency mask

Sat Apr 14, 2012 3:27 pm
Ah, but saving and restoring a selection is already possible: every global selection can be saved as a "local selection mask" and restored to a global selection (unless I forgot to add that menu option...)
canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Sat Apr 14, 2012 4:38 pm
That's right. The poblem is still the distinction between a selection and a greyscale map, they are treated as separate entities.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Transparency mask

Sat Apr 14, 2012 4:41 pm
Well, all masks -- transparency, filter and selection, are "selections". That is, all of them should be grayscale, not alpha.
canaldin
Registered Member
Posts
42
Karma
0
OS

Re: Transparency mask

Sun Apr 15, 2012 1:50 pm
I made a short video summing up what we've discussed here. This video is made using photoshop but it applies also equally to gimp, but I'm not yet as confident with gimp :). This video illustrates common workflows of converting selections to masks and viceversa, and also managing masks. I forgot however the part on adding and subtracting masks. As I said earlier there is no way one can copy and paste information into a mask if not through the workaround of converting it to selection. This could be a good point on which to extend functionality beyond what photoshop can do, as it is for now the most challenging competitor.

http://www.youtube.com/watch?feature=pl ... PhQ#t=130s
cson
Registered Member
Posts
8
Karma
0

Re: Transparency mask

Mon Apr 16, 2012 6:36 am
try erase blender mode it's your friend


Bookmarks



Who is online

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