Add ability to save clipping masks in PSD files and make it cross compatible as much as possible

I think it would be useful to krita users having an inherit alpha mode that only takes the alpha from the layer below (it would be useful for me, who uses only krita nowadays). It would save some steps if you only want to achieve that, you wouldn’t have to create a group. And it would keep the layer stack shorter.
I don’t know if it would be easy to implement, although it seems it should.
Now, how easy is to write/read clipping masks from a psd is another thing. I remember having headaches trying to kind of reverse engineer ps’ gradient format some years ago, and that was a “simple” format.

Perhaps there could be a way to implement two modes. Clipping to single layer being the default and clipping to everything below an alternate . By clicking on the alpha icon it would clip only to layer below, but if you click the alpha icon whole holding shift it would enable clipping to opaque pixels of all layers below. The alpha icon can be turned to different colour (dull red) to show that the alpha inheritance is in alternate mode.

This can be even more powerful the user can choose to enabled both type of alpha inheritance based on the situation.

I don’t know how easy it is to implement this. But for normal users coming over to Krita from other software the default mode of clipping the layer to only ones below would be enough and for krita users they can access earlier mode by simply holding shift modifier and clicking the alpha icon. This will also give us a way to keep compatibility with older krita files. The older alpha inheritance enabled files will have different icon to denote the old mode.

P.S typing this from mobile so please excuse my typos

I think that would be the best solution. I suggest to just use single click to rotate between modes. That would make it easy to change with a pen or finger on a tablet, and the icon change would be enough to show the selected mode.

That’s literally what I suggested before. And it something I wanted for a while now though before was a clipping mask and inherit alpha to be separate.

I repeatedly request members to keep the thread on topic, please think before writing, occasional off topic replies is okay but if you think that the discussion is growing please let the moderators know we will move the discussion to new topic.

This is a misunderstanding. Photoshop and csp have a blending mode called “Pass Through”, just like krita’s pass-through mode. The difference is that one is enabled by default and the other is disabled by default.They can also do in-group blending first, but I don’t know why it’s not set as the default in photoshop.If you change to “Normal”, their mixing method should be the same as krita.

CSP’s clipping mask is better than photoshop, because photoshop groups cannot use clipping masks.If you use a clipping mask for the group in CSP, it will “explode” in photoshop

Krita can achieve all the effects of clipping masks. But some simple layer structures are better without creating groups. In addition, alpha inheritance won’t work right when turning on pass-through on the layer. This is also a point that needs to be changed.

So my thoughts are the same as above. Not for compatibility with photoshop, but for more convenience. This may have to be changed in the “Layer Properties” page. There is only the option of whether to turn on “inherit alpha”, and there is no “inherit alpha setting”. It can even be set to inherit the alpha of the layer marked with color. In this way, we can combine with almost any layer.This may be a little more complicated, but it should be considered a less difficult task than reverse psd

You are misunderstanding something :slight_smile: Krita’s pass through mode was added later to be compatible with photoshop’s one for example while saving psd files etc. Krita initially didn’t have pass through. Pass through means the group doesn’t behave like a unit, all the layer inside it behave as if they are outside, hence the alpha inheritance doesn’t work because it switches its base layer to the by combining all the layers outside of the group :slight_smile: It is one of the problems you get when you implement concepts from other programs into a program which has its own way of working.

This is a good case study to show how mixing functionality from two different programs which have different underlying concepts and assumptions don’t work. When you implement something like that you get some features which don’t work as expected for example you said alpha inheritance doesn’t work on layer which has pass through. And by trying to fix that you will changing how Krita’s layer works in to something like how photoshops layer work. :slight_smile:

You see slowly the feature creeps and changes the application to be just a copy. Instead accept that Krita works in its own way and try to learn that way when working with krita.

Note for further reading: Check out this mail when the pass-through feature was announced in 2015 to solve this bug
Also read these bug reports 1, 2, 3 all concerning making a pass through blend mode to match photoshop. Also note that devs talk that Krita’s layer system is different than photoshop. But nevetheless the devs implement this mode and now here we stand using this limitations added by this feature we see request to change another feature.
So where do we stop copy one feature then based on that feature ask another feature and then finally make a clone.

This is the reason why we shouldn’t copy things, if the underlying principles are different, to copy a feature you need to change those principles otherwise there will be limitations and then users will cite these limitations to justify further copying. it never stops.

I have changed the title of the request to be more suitable to initial post, since people see layer clipping masks and jump in and say unrelated things to the actual feature request and take the thread to offtopic discussions

Perhaps, I thought you were saying that ps and csp can only mix layers from top to bottom. But in fact they can also be changed, only the default options are different from krita

I know… Actually my focus is on the improvement of inherited alpha functionality. I don’t use “clipping mask” to call it, I also stated “not for compatibility with photoshop”. The mention of “alpha inheritance won’t work right when turning on pass-through on the layer” is just a passing sentence. I have additional ideas about this feature that are not compatible with ps
I understand the annoyance of “copying” other software features. Especially closed software like ps. When I was studying hard-mix blending mode a few days ago, I found that its actual algorithm is even different from the introduction! Researching and cracking psd is undoubtedly a waste of time. I prefer to spend this time on krita

Yes, this is off topic, or move to a new post? I have made a little expansion model for inheriting alpha in “layer properties”

Being able to open PSD with the clipping relationships intact was at least equally as important a reason for my initial post, as being able to save them (more so for my personal use, actually). AFAIK, Linux offers no native programs able to open a PSD without all clipping relationships breaking (other than Photopea, I guess that counts).

This seems impossible/highly improbable anyways from what’s been said, but I thought it worth mentioning.

More to the original point, I still do take issue with Krita’s method of doing things, again not because I dislike using it (the related thread about lessening indentations removes my only real quibble), but because no other program is capable of making use of it. Even if other art programs could use ORA (or any other format to pass layered files), the group structures Krita uses are fundamentally incompatible, despite offering nothing functionally unique when compared to art programs such as CSP; Photoshop has fallen pretty far behind in this regard and so I don’t see the point in comparing to it.

So in all, I don’t really agree the new title indicates what I was actually suggesting, but IDK how much it really matters anyway since this doesn’t seem resolvable, since it’s been extensively covered that both greater PSD compatibility and overhauling the inherit alpha system are unfeasible and undesired.

I just think it’s important to note that the chief roadblock to cross-compatibility isn’t PSD, which is just a single format that’s currently in widespread use. That may change in the future, but the fundamental structural incompatibility will not. Hence my original title.

Can you suggest a proper title instead of generic one. Your original title was - " Layer Clipping Masks" which doesn’t explain what is the request at all. By reading the discussion it seems you need clipping mask compatibility with PSD hence the new title

Please also file a bug report in respective application which don’t make use of Krita’s structure, ask csp people to open kra file. A feature’s usefulness is not measured by how much it is compatible with apps, they may do what they want why should we design around their architecture? It is one thing to implement compatibility and other thing to design your application based on behaviour of other app

I still have no idea what passthrough is for

It’s what photoshop originally did for group layers; it was only later on that they copied our independent groups.

@kolloom Pass-through modifies the order/structure of compositing for producing the final/visible image.
Groups are usually composited separately, as distinct items before being included in the rest of the compostion ‘flow’.

If pass-through is enabled on a group then the compostion flow comes up into the bottom of the group and includes all the layers in the flow order instead of using the single separately composited group image.

The best way to learn about it is to play with it and see what happens.

The request is really for better clipping mask cross-compatibility with other art apps. So maybe that would be a better title. I think the core blockade to this compatibility is inherit alpha’s differences from clipping masks used everywhere else. Many replies think PSD compatibility is the primary issue, so we got quite mired down discussing that. I disagree on the basis that any format is made equally incompatible by inherit alpha, but again, this doesn’t seem resolvable.

You don’t seem to understand. Even if they could open them and convert the inherit alpha layers to clipping layers, the folder structure is often incompatible. Readjusting things to un-break them would continue to be necessary, similar to how exporting PSD already is. And besides, I reiterate opening is as important as exporting for actual cross-compatibility.

Also, I could go around requesting nearly every art app in existence implement converting .kra’s unique clipping system into their own, or I could suggest Krita behave like everyone else. It’s clear which of those is the more concise solution to the problem. There’s no reason (other than limited dev resources, which I understand is a real problem) not to have the same system, since the same functionality is afforded, and cross-compatibility is much improved. I know it’s not easier for Krita’s devs, but it just makes more sense as a request, whether or not it gets fulfilled (I don’t imagine asking all other dev teams operating on a for-profit basis would yield any better results anyways – I don’t entertain the idea that .kra compatibility is in any real way profitable or useful for them, not any time soon at least). In any case, no program I’ve seen implements cross-compatibility by supporting their competitors’ formats (this is largely pointless because as previously discussed, unique properties of each format aren’t translatable) – they achieve it by supporting a shared single format that allows translation of 90% of functionality (this is currently PSD). I did file a request for ORA support, but I don’t count on that happening any time soon.

So, I understand this request is looking like it’ll go unfulfilled and Krita will remain the program with the decidedly worst cross-compatibility, but I just wanted to outline how I arrived at the request. And I understand there are real reasons for this, it’s just unfortunate.

The answer to this, is because if you want cross-compatibility with other art apps, inherit alpha offers no unique functionality (the true measure of worth; if it was uniquely powerful I would take no issue with it) and is structurally incompatible with other art apps, and so it cannot remain as it is.

That presumes that you want to be cross-compatible, of course. I think it’s a good idea for Krita’s longevity and for the ability of new users to adopt it, but I seem quite alone in this.

@Agitato why don’t you fine tune the request, specifying how you want all of this to be incorporated into Krita? With mockups and taking into account the corner cases, for example for the inherit alpha from just the layer bellow. How would it impact the Krita workflow? Can there be unexpected issues? One step at the time. Or if you want a better challenge try to decode how that is saved in a psd and write it here. If you don’t know how to code that’s how you can contribute to make Krita better.

The Krita team has a lot (a LOT) of things to be done and any help from others is great. I don’t think this feature request is irrelevant, but I think they have other things in mind with higher priority.

Maybe some developer that is not in the team also wants to implement this and you can ease his work doing what I said above.

The earlier post of mine I’m replying to outlined what I believe to be the current best solution.

To reiterate, I think overhauling inherit alpha is both unfeasible and undesired by current Krita users (and would break old .kra files, the list goes on for why it’s not a realistic option). Therefore, allowing users who want cross-compatibility to consciously work around it is the best solution. You wouldn’t be able to open all Krita files intact in other programs, but you could open your own if you wanted to, and you could open files from other programs. The caveat is that it all hinges on greater PSD compatibility (since there is no other format with such widespread compatibility), which many here quite vocally opposed investing any development resources in.

My proposed solution is different from what I personally want (which would be to have it function identically to CSP), but that’s obviously not a good solution for all the covered reasons.

How would I go about decoding this if I don’t know how to code? I’m up for taking a shot, but I’m a total novice, if you wouldn’t mind explaining.

I understand, no rush. As a new user, I just felt I was seeing a problem nobody else was – “Krita’s cross-compatibility is so much worse than other apps, why? Oh, this clipping system seems to be the culprit,” etc. etc.