Nevermind, it was just a comment. Digging into the internal structure of the file is hard even for experienced developers (due to the closeness of the format mainly).
I think the first step is to make another mode for inherit alpha such that the layer only is clipped by the layer/group below. But it would be great to imagine beforehand possible issues and scenarios. When that gets done then will be time for psd fun.
So, how does CSP work with clipping masks? Does it have anything special? What are the usecases for those special features, if it has any? Is there a specific page/video were I can see a detailed overview with usecases apart from the manual? I have no access even to the demo since I use linux.
Yeah, that seems the best place to start. For your own files, I don’t think it’s strictly necessary, although it’s a feature I would like to see for the reduction in required folders. If you organize your inherit alpha groups with compatibility in mind for other programs, it’s not needed.
Actually, unless this new inherit alpha mode functions exactly as clipping masks do (which is what the original feature request was for), I don’t think it has a purpose, for cross-compatibility at least. In order to open files made by others without Krita’s system in mind, it needs to be able to clip multiple layers/groups to only the first non-clipped layer/group. Otherwise only the first clipped layer out of however many will ever be functioning properly. But from what I’ve been told about Krita’s grouping and method of compositing, it’s unable to do this, correct? Which, again, leads me back to my seemingly unfulfillable original request for layer clipping masks.
I did some comparison tests using a file provided by @tiar earlier in the thread (is there a way to link to a specific post other than by replying to it?). But essentially, it allows for all the same functionality of inherit alpha through clipping of and to groups. For more complicated arrangements, CSP’s system is clearer imo, but Krita’s inherit alpha can be cleaner using simpler structures.
For example, if you want to clip five layers to three layers beneath them, in Krita you would just group them all and enable inherit alpha for the five layers above the bottom three. In CSP, you would group the three layers you want clipped to, and enable clipping mask for the five layers above that group. You could alternatively group the five layers, and clip that group to the group of three layers, clipping a group to a group (and you could clip a group of groups to a group of groups, on and on.
Unfortunately, it’s difficult to explain without actually being able to try it for yourself imo, and any videos I can find are way too basic to be useful. But I suppose none of this matters unless clipping information for groups is able to be stored in a cross-compatible format, and PS can’t do this kind of clipping. I actually need to double check if .clip files exported as PSDs are able to do this, although I assume the answer is no. In any case, manually re-enabling clipping/inherit alpha for clipped groups is far less work than manually re-enabling it for every single clipped layer.
That is saving/preserving the clipping mask in PSD right, which is what the current title says, or do you mean change the title to “Change the Krita’s clipping mask functionality to mimic clip studio paint”?
yes that would be helpful to check without that cross compatibility is a myth as there would always be some part which is not compatible
Thinking on it more, I’m pretty sure an additional inherit alpha mode isn’t necessary at all, provided that:
Krita is able to recognize and interchange clipping mask and inherit alpha enabled layers when importing/exporting PSD
Automated creation of groups around these clipping mask enabled layers, and the layer they are clipped to, is possible when importing PSD
These are big assumptions though, so IDK if this is actually possible.
But essentially, compatible export is already possible if the user uses the proper folder structures, and #1 is possible. Import would be made compatible by automatically grouping layers with clipping mask enabled, with the layer immediately beneath them and converting them to inherit alpha layers. I think this would allow for functional clipping relationships when interchanging files, but I could be missing something since I haven’t tested, and I’m not sure if it’s even possible anyways.
If automated grouping isn’t possible, enabling inherit alpha for the clipping mask enabled layers when importing would be 3/4 of the battle at least, since the user can more easily see points of breakage and manually fix them when importing (as it is now, you have to know each and every layer meant to be clipped in advance). So, if #2 is impossible but #1 is possible, cross-compatibility would still be much improved.
Once again, I acknowledge that 100% compatibility isn’t possible, but if I want to move a file between apps, I just avoid the more complex clipping groups, which I rarely use anyways, and everything works seamlessly. Singularly not the case for Krita, which is why I raised the issue.
Yeah, adding a group may be possible to create the structure that Krita expects, But there is also an issue of passthrough mode, so the group needs to be in pass through mode to take into account all the blend modes for layers above to work correctly with the clipped layer. And when group is in passthrough mode the alpha inheritance switches the base to all layer outside the group too
If I understand correctly, might this (exporting from Krita anyway) be solved by having a tool, say a python plugin, that would look for Krita-specific layer structures and convert them to a more cross-compatible structure? This would then be an explicit action the user takes before exporting, and would not require any changes to current file types or how they are handled.
I’m actually confused as to what pass through mode is for. Blending modes of inherit alpha enabled layers seem to work fine without it enabled, so I must be misunderstanding the reason to use it.
In my proposed grouping method, clipping mask enabled layers would be grouped with the layer they’re clipped to upon being imported into Krita, so that inherit alpha can take over properly. Am I wrong in thinking this solves the potential issue? Again, I’m not sure what pass through is even for, so I could be totally missing something.
Well, even with such a tool, point #1 from my proposed solution is still a necessity.
Such a tool could potentially be useful for cross-compatibility in exporting files not made with export to other programs in mind, but as we’ve established, complete compatibility is impossible, and if PSD is the format being used for interchange, as is currently the case, many more advanced clipping structures possible in Krita/CSP etc. wouldn’t be translatable by any plugin, since they’re simply impossible.
Pass through mode is the default blend mode for the groups in photoshop and probably clip studio. When pass through mode is enabled the blend modes of other layers outside the group affect the layers inside the group. it is as if the layers inside the group are outside it. so if you have a layer with multiply blend mode outside of the group it affects layers inside it.
I don’t use Clipping Group so I’m not a expert when I say this, but I remember of one topic here on KA where pass through was a good option. If I’m not mistaken the user wanted to extend the clipping to layers outside the group. Using the pass through was a good option that enabled nesting multiple clipping group.
Bellow a screen shot from what I remember from this specific case.
Also, other case I remember: If the base layer from a clipping group have a different blend mode, it will be treated as having the normal blending. The pass through allow the base layer to keep it original blend.
Ah okay, I see now, it’s for grouped layers with blend modes to affect the layers below them. I was thinking layers above and in the group, which works fine. Thanks for the examples! I’m also very skeptical of the actual utility this has, lol, but maybe!
I think when groups are used in this way in PS, where I don’t imagine it’s used for the edge-case clipping relationships illustrated here since group clipping isn’t a thing, wouldn’t automated ungrouping of such grouped layers resolve the issue when importing? Such groups are only for organization rather than functionality in PS, no?
I really think the best that can be done is to have the new alpha inherit mode because:
that would improve the compatibility with psd. You just use the new mode and it is saved as clipping mask, and clipping masks are loaded as this new mode. Any other conversion or adaptation of combinations of inherit alpha and pass through, since there is no “standard” accross apps, should not be mixed up in the normal workflow. This approach is simpler than having to rearrange the layer structure on import/export and the layer structure itself would look like the ps one when the psd is imported. For exporting to psd you just would have to keep in mind that certain combinations of inherit alpha are not possible. Krita could warn of that when exporting. Now, I’m not saying that automating that process of adapting the layer structure so that the result image, when loaded in ps or other, looks like in krita, has no value, but it should be a separate step that the user takes consciously, via a menu entry or checking an option when exporting. Maybe as a script or extension. Nevertheless having the new mode is clearer and cleaner in any case since it translates better.
I must say I would like having the new inherit alpha mode (ability to inherit only from the layer right below) not for the reasons I explained in point 1. I only use Krita right now (gimp sometimes) so I want it because it would improve my workflow, since a lot of times I only want to clip with one layer. That way you don’t have to make a group, deal with pass through, etc. It’s just for convenience. But it has the side effect that it also improves compatibility.
Having a group allows you to organize the layers better in any case.
Pass through indicates if the group must be composited together before it is rendered into the image:
with pass through on, the group is used only for the sake of organization. You could have the same layers ungrouped and the rendered result would be the same.
with pass through off, you can think of the group as a litte image in itself that is prerendered, composited together, and the result of that is painted in the image. This means that the contents of the group are not affected by the layers bellow, only the composited image is.
I think I had given this suggestion earlier or somewhere may be on IRC. The single layer clipping can have a modifier shortcut to trigger it, that way the method to clip will be similar and users won’t have to learn one over the other.
For example pressing the alpha icon normally would enable Krita’s alpha inheritance and pressing it while holding down shift will enable the single layer clipping, the icon can be turned to some other colour may be orange or blue to denote that an alternate clipping method is being used. This will give the opportunity to user to use both mode or any one based on the need for that particular group or layer.
So let me get this straight… you guys are now calling for a new inherit alpha mode that functions identically to clipping masks as the best solution to cross-compatibility… i.e. the implementation of layer clipping masks into Krita… which is exactly what my original feature request was for, and what the title of this thread was, before everyone derailed my request with why alpha inheritance is superior, and why PSD will never work… correct?
Sorry, the irony is killing me
Glad to see it, though!
From what was explained, I thought this method of clipping was made impossible by Krita’s method of grouping and compositing, which is why I had given up on it, but since you guys think it can work, I must’ve misunderstood.
It seems to me that the best default behavior when importing PSD is for only groups without any clipping relationships to have pass through enabled, no?
If the upper layers in the group are clipped, they won’t need to affect anything else through pass through anyways, and if they aren’t clipped to anything, no clipping relationships will be broken by enabling pass-through. It’s hard to imagine potential problems without testing, but I think this would work?
In any case, even if detection like this isn’t possible, I think having pass-through disabled by default is better, since instances where it’s needed are rarer than instances where switching it on breaks clipping relationships, at least for my own workflow and others I’ve seen. Maybe it could be a toggle when importing PSD? " Auto enable pass-through for groups" ?