Potential improvements to Inherit Alpha in Krita

This thread is a continuation of Add ability to save clipping masks in PSD files and make it cross compatible as much as possible, which meandered quite a bit and contained a lot of digressions. In this thread, I would like to ask any participant to stay on the topic.

I’ve seen that some people discussed possibility of improving the inherit alpha system to allow for inheriting alpha from just one layer, like the clipping mask in other applications, or even an arbitrary selection of layers. I myself don’t need this, so I’ll give you a stage to present your ideas and your needs.

Rules for discussion

  1. Do NOT discuss Krita’s compatibility with clipping masks of any sorts; it’s already being discussed in Improvements to PSD compatibility (clipping mask) in Krita, with PSD compatibility since it’s I believe the only file format Krita can read that has clipping masks. For all future formats, we will be probably able to use the same algorithm.

  2. You need to present the feature without referring to other applications. If the feature is good, it should stand on its own. If you haven’t read How to make a feature request Manual Page, you should do so asap, to know how to talk about a feature.

  3. You need to start from what exact feature you want, and then tell us what is your workflow and how this new feature would improve it. If you can think of any bad sides of a new feature, for example confusing new users etc., please do mention them, too. Try to think about currently existing alternatives in Krita, in particular how you can achieve the same thing using the currently working inherit alpha, and using the Destination Atop and Destination In blending modes (if you haven’t tried them already, try them - maybe just an easier access to those blending modes would fix your issue?).

Possible new features:

  1. Inherit alpha inheriting only from the layer just below the current layer.

  2. Fast “clipping group” creation, by dragging a layer into a specific part of an existing layer. Maybe you could drag a layer onto an inherit alpha icon on the other layer, and that would create a clipping group? That would make it more accessible (less clicks).

4 Likes

Here’s my suggestions to improve the current Alpha system with this mockup.

If you choose to enable Use Existing Layer?, you will be able to pick a layer to use as base for inheritance of alpha. Otherwise, you have to choose the direction, and inheritance level. Some options will be enabled/disabled depending on your setting on the first option.

On Inherit Alpha Direction, this defines which direction should the inherit alpha go.

On Inheritance Level, this only works within a group. This defines if a layer outside a group below should define the inheritance of alpha.

Here’s the g’mic code for testing:

#@gui New Inherit Alpha: fx_rep_inherit_alpha, fx_rep_inherit_alpha_preview
#@gui : Use Existing Layer? = bool(0)
#@gui : Existing Layer = text("Layer 0")
#@gui : Inherit Alpha Layer Direction = choice(1,"Above","Below")
#@gui : Inheritance Level = choice(0,"Inside Group Only","Outside of Group")
fx_rep_inherit_alpha: text $2
fx_rep_inherit_alpha_preview:
u "{$1}"\
"{$2}_"{$1?2:1}\
"{$3}_"{$1?1:2}\
"{$4}_"{$1?1:2}\

I would absolutey love to be able to just clip one layer to another withouth creating groups.
You have 2 layers, you press inherit alpha on the layer above - it clips to the layer below and that’s it.

Essentially, I want this structure to be possible without creating groups.
Color coded for better udnerstanding what clips to what in this example.
But generally speaking some visual representation that one layer is clipped to another would be cool as well!

Why would you want it without groups?

Fewer steps to achieve the same result. Less hassle. If things get more complicated sure I use groups eventually, but in most cases I’m personally good without groups as I tend to work with fewer layers and don’t need comlicated group structures.

I see the value in grouping clipped layers and clipping groups to groups, but I personally see no value in having to create a group just to clip 2-3 layers together in a simple system like that.
If groups could be clipped to each other and layers clipped to groups the same way, without creating a group for groups and so on, that would be stellar as well.
Also easier access to layers without having to go through multiple groups when they are not collapsed.

Additional advantage - it’s more intuitive for people transitioning to Krita from other programs.

And additionally if layers are possible to just clip to each other and layers are possible to clip to groups, this structure now becomes a possibility (where a layer clipped to a group affects all its contents, including the groups in the group) without creating even more groups and juggling all of them - just a bit cleaner workflow:

1 Like

@Reptorian:

What happens when you have a layer structure as such:

A
B

Layer A has inherit alpha direction set to “below”
Layer B has inherit alpha direction set to “above”?

To answer my own question, Krita needs to catch this case and not allow changes to be made that result in infinite loops like this. I think that can be done. Edit: I think you solved that already. :smiley: The bigger problem, to me, is that this breaks the convention of layer ordering and will probably tend to be hard to reason around for the user. Could you outline a use case for this so we can compare the mental complexity to the work required to do the same with the current layer system?

1 Like

Also, if you clip to the layer above, the layer below would take the shape of the one above which would obscure the layer below completely, isn’t it? Or maybe I didn’t understand. Can you elaborate on that?
Generally, I would try to keep the system simple, with the inherit alpha as it is now. Then the inheriting from the layer below which is just kind of a shortcut for when you just want to make quick edits. The option to choose a specific number of layers wouldn’t add much complexity to the code I think, but it would in the ui. How would that be solved?
Your suggestion is more difficult to do in the code and in the ui. But I would have to see its use cases and complete ui to make an opinion about it.

@hulmanen

I think there should be exception to the case of below and above. Like, that action shouldn’t be permitted.

For use case (though not for painting, but for other applications as it’s more applicable there), I can see that one can utilize alpha from another layer located in another place in the layer docker.

The above shows an actual example which could use my concept. In the clipping layer, it is basically a clone layer with Destination In Mode. But if I could pick which layer to clip with, I would not need to use clone layer, and instead use my version of inherit alpha to do that work. Shortening the number of layers required to do the same.

As for @Deif_Lou, On clipping of above, one can use blending modes to avoid the obscuring of layer below. This also avoids the need of using multiple layers (where one is set to Destination In) to do similar job, and the second above layer is a blending layer with inherit alpha. Might serve for t-shirt design for example, but not much use I can see from above mode, but it still shorten the number of layers in rare cases.

I am also a person who pursues simplicity .There are no more reasons. Inheriting to one layer and multiple layers reduces the number of groups in different situations, I will use them in different situations


In my scenario, the layers are blended from bottom to top. B crops to A's original alpha. A crops to B's processed alpha But well, I don't think that's a good idea either ......

We can group different things together. Now we can only:

  • skin-detail
  • skin-base color
  • hair-detail
  • hair-base color
    And to achieve it we can:
  • group1-detail
  • skin-detail
  • hair-detail
  • group2-base color
  • skin-base color
  • hair-base color
    Then we can close the details group at once

Maybe it should be consistent with the effect of “Destination Atop, Destination In”?

Indeed, I felt trouble myself. Maybe this needs a nodal structure …
Then I would like to know the opinion of the developers involved. If it is impractical, I will give up the fantasy

1 Like

I also share the desire for simplicity. IMO, the freer the user is to use or not use groups, in their own way, the better. For my part, fewer mandatory groups means less nesting indentations, which means easier readability at a glance, and less width required by the layer docker on my screen.

IMO the system @Dima_Derzhavin has described (clipping to and of both layers and groups) is the best balance of flexibility and usability (powerful enough to support many clipping relationships, while still being intuitive and easy to use and represent in the layer docker UI).

I think the other more flexible system being explored here to clip to any layer could also coexist seamlessly, if by default clipping was done beneath, but there was an option to set it otherwise in the UI, and a visual indication was given for indicating more distant clipping relationships (a number or color, etc.). The clipping system would then retain its intuitiveness, while also allowing such powerful flexibility.

But the mockup provided here:

and most of other software still uses indentation, it’s just that the base layer is not indented, but all other layers are.

Also this actually makes it more confusing at least for me - a native Krita user (and a bit of Gimp, long time ago) - because the indentation usually means it’s the child of the first node above it that has a smaller indent (which is true for both children of group layers and for masks). And this kind of indent breaks this understanding.

Uhh, sorry, I linked wrong image…

Ah sorry for the miscommunication, I wasn’t looking at his mockups as UI representations, I was only referring to the functionality. In this case, I would recommend a “half” indent, or better yet, a visual representation of clipping that doesn’t involve any indentation at all. For example, an alternative icon in the same slot currently occupied by inherit alpha, etc.

And to be clear, these new clipping methods could also coexist with inherit alpha – I think a lot of what damaged discourse in the last thread was an either/or mentality. If the layer is inheriting alpha, that icon could also be displayed, they would just be sharing the same slot, since one layer can’t do both at once. Legacy compatibility is maintained, and established Krita users wouldn’t be negatively affected.

1 Like

This just like a parallel grouping system to the current one that would disrupt all operations. Thing about parenting there no half parenting or it is or not.

The current grouping system will probably have to be changed to make such a change and I am unsure if breaking that is worth at all. I fear some modular functions will cease to be because of the order of operations.

Would this not work better like a mask instead of a weird layer?

The only thing I see worth on this is not having one less group to clip with limited function on it. It only serves people that don’t organize their scene. Would not making group layers look slimmer solve this just the same?

Someone likes after effects hehe but that does work for the limitations of layers. Is solid suggestion probably the best of the thread.

allow for inheriting alpha from just one layer, like the clipping mask in other applications, or even an arbitrary selection of layers.

I think allowing inherit alpha to work with just the layer below would be good. Currently, the “inherit alpha” button on the layers docker is an on/off toggle. I suggest changing it to off/clipping group/inherit alpha, or off/inherit from layer below/inherit from all below.

The clipping group icon could be a down arrow or something to hint it’s part of a clipping group, that way you wouldn’t need indentation on the layers docker.

I think if you indented layers clipped to the layer below it would look weird, because “inherit alpha” is effectively “clip to all layers below composited.” You could indent both of them, and “clipping group” has a down arrow while “inherit alpha” has an X or something, but if you’re going to do that, it makes more sense to just use the inherit alpha button to show something is part of a clipping group by showing a down arrow instead.

A GUI mockup:

I don’t think an arbitrary selection of layers is necessary. It sounds far too complex. In the unlikely event you need it, you can do it by cloning the layers you want, putting them into a group, and using one of the alpha modes.

I think it’s important to note that everything you can do with “inherit alpha” you can do with “clipping groups,” and vice-versa. It’s just a matter of how you end up having to organize the layer folders to get the result you want.

Most software uses clipping groups, though. SAI uses them. Firealpaca uses them. Affinity designer, which is a vector program, lets you draw a shape that shows up like a layer in a layers/shapes window, and then you can drag a shape into another shape to clip it.

In fact, I don’t really know any software that has inherit alpha like Krita does.

1 Like

Maybe there should be 3 level of alpha inheritance level ?

Level A - To one layer below only.
Level B - To all layers below within group.
Level C - To all layers below outside of group.

Level B is the current level. Users should be able to define default alpha inheritance level.

Some artists do export shape masks for painting. I think this would be useful for them. They can always go into layer property via my mockup. Drag and drop as mask would work too.

I just remembered doing that with clone Layer and alpha mode.

What if the layer is inside a group inside another group? Because at the end of this trail you’ll probably find a “background” layer that just fills the entire canvas.

I think if I needed to do something like this I would just take the layer off the group, or split the group.

Have you ever needed to put something into a group and clip just one layer in the group to the alpha outside the group?

@leo Fair point. Then there should be a cutoff range then. I didn’t need to do that since my painting involves mask via cloning layers and Destination In.

Yeah, you could do all the masking with that, but the question is what sort of masking should be quickly available, and the answer should be the sort users use most.

I don’t think people want the “level C” you mentioned. I think people ONLY want what other software already have, which is the “level A.” It just happens that Krita uses the “level B” instead. Level A and B are interchangeable: anything you can do with one, you can do with the other, except with a different layer group arrangement. That’s why Krita isn’t desperate to implement A, because you can already do the same thing with B. Level C is not interchangeable with them.

The only time “level A” is more useful than “level B” is when you have a folder structured like: one layer, a bunch of effects clipped to it (e.g. shadows, textures), another layer, a bunch of effects clipped to it, repeat.

Because if the clipping mask is formed by 2 layers, to clip you’d need to group those two layers and then clip to the group, and since you made a group already, you could just put the clipped layers into the group and use inherit alpha instead of clipping. The whole “clip to the single layer below” only makes sense if the mask is really a layer (not a group), though functionally there is no reason why it shouldn’t work with groups.

It just happens that for some artists it’s very common to use one layer as base layer then throw effects clipped on top of it, and very unusual to have a clipping mask made out of multiple layers, so level A would be used more often than level B in their case.

Edit: for reference, see that many “coloring tutorials” will have a layer with multiply blend mode clipped to a flat-color base layer.

SAI: youtu.be/Zv1HyVoh27c?t=418
Clip Studio: Clip Studio Paint Pro tutorial Part 2-4 | Colouring basics: Basic anime-style painting - YouTube
Medibang: Fast Coloring Tutorial [medibang] - YouTube

4 Likes