Add an option to make Alpha Lock/Preserve Alpha work on lowering alpha, too

I am currently being driven crazy by the fact that Alpha Lock/Preserve Alpha do not apply to Eraser mode - I cannot increase alpha of pixels but for reason I cannot comprehend I can lower it.

This basically makes Alpha Lock incredibly weak - because it does not actually guarantee prerserving alpha, it just prevents adding pixels.

I think it’d be nice if there was an option to make Alpha Lock work both ways - make it protect alpha from increasing AND lowering.

Is this a riddle, a puzzle? Can you provide a real-world use case? I’ve been sitting here for about 15 minutes trying to imagine why I’d need a mode where I can’t erase pixels. And on top of that, I can’t add pixels. What?

1 Like

I kinda can understand what you mean but what should happen instead? Why using eraser mode on a alpha locked layer in the first place if not to erase? I assume you want nothing to happen.

1 Like

You may be able to do this already with a consistent setup. For example if you are drawing a character, you may have a “base” layer which might include both fill, shading, and lines. This can be converted into a paint layer containing only rgb, and a transparency mask which contains the alpha. The rgb layer will have black background in areas of existing transparency.

Select the layer and right click on it, then select Split Alpha -> Alpha into Mask or go to the menu Layer -> Split -> Split Alpha -> Alpha into Mask.

If you put both inside a group as siblings, you can further edit that rgb layer, and add layers above with Inherit Alpha checked, and paint in those. It doesn’t solve your issue yet as both are a roundabout way of using Alpha Lock.

However, if you add a paint layer and set the blending mode to Erase you can erase non-destructively. It doesn’t mean eraser mode will work, it means value added to that layer will be composited as if you used eraser mode. If it adds too much overhead or complexity, merge/flatten the layers after some time and retain the original base layer if still necessary.

@wpfosh @Takiro if you literally lock the alpha channel, it would erase only the color channels. So effectively it’d be the same as drawing over it with black in Normal mode. SAI works this way for example.

People being utterly confounded what this would even do explains pretty well why Krita doesn’t behave that way.

Edit: not that this makes the feature request invalid. Brain-compatibility for users coming from other programs is an argument in favor of it anyway.

2 Likes

I quite regularly damage layers with locked alpha because when switching brush presets I forget that I left it in erase mode when I last worked with it on some other layer.

Then comes the usual quest “how many strokes did I do before noticing my mistake” so I only undo the unintended erasing, which can be tricky if I only did strokes with low pressure.
I would prefer if the brush tool in erase mode just did nothing on an alpha locked layer, just like other tools refuse to work on “fully” locked layers, possibly with a floating notification.

On the other hand, “fully” locking a layer is extremely aggressive, it prevents you from just about anything, even opening the layer properties dialog where you could also remove the lock :kiki_annoyed:

wpfosh - I can’t add or erase pixels, but I can change their color. Also I am pretty sure this is how alpha locking works in literally every single other art program I ever used, it straight up just locks down the alpha channel.

Also: I think this is incredibly counterintuitive to only have a mode where you can erase pixels, but not add them. This does not protect the information on the layer, if anything it encourages destruction of information on the layer.

Also: it is inconsistent with documentation. Docs say Alpha Locking a layer prevents modifying it’s Alpha value, and that’s a big part why I was surprised that I absolutely does not do that.

In Gimp I even have multiple ways to do this, as I can straight up remove Alpha channel from any layer I want. (Most of the time it’s more annoying than helpful, but this debacle made me realize why Gimp even has such an option.) So it feels weird that probably the best free art program out there doesn’t have any such option at all.

I use a Multiply layer with a white fill for shading, and this way when I want to copy a partial shadow color from elsewhere in the drawing I can just colorpick this layer and paint in the color I just picked. I can’t do that if the background is transparent because then color picker will not pick up the Alpha value, just the RGB value, so even the faintest shadow will read exactly the same as the darkest one. But if there’s solid white fill on the entire layer, the color information will change and I can colorpick it on sight - and because of how Multiply works it will not affect the result.

Takiro - it doesn’t matter what happens. Either turning it pitch black like Drawpile says or not doing anything would be an immediate sing to counter my muscle memory “Ah, I’m not supposed to do that”, making me immediately notice the mistake.

general-avalanche34 - I will try that as a solution to my personal problem, but just because there’s hacky complex workaround doesn’t mean it shouldn’t be a feature. Not adding a feature even if it has an use, because technically you can do it with a weird workaround is the biggest issue people have with GIMP and why Krita took it over as the premier open source art program. So you know, we should probably be learning from failures of GIMP.

Lynx3d - Yep! That’s another use case.

(Sorry for broken “at”s, apparently there’s a limit to replies on a single post for new users. Also even when I removed the replies but kept the “at” character it still triggered the effect, so I think that might be a glitch in the message board code).

1 Like

Also I am pretty sure this is how alpha locking works in literally every single other art program I ever used

I guess to fill that out a bit since it’d be relevant for considering an implementation: SAI turns it black, CSP erases by default but has a setting to turn it white, GIMP does nothing and balks that the layer’s alpha channel is locked, Drawpile always erases (and it’s a local property), MyPaint doesn’t let you alpha lock layers at all (only your tool.)

So there isn’t much of a consensus between programs in that regard.

2 Likes

Are you sure this approach works? I tried it the way you described it and it did literally nothing to prevent layer from being erased.

For your purposes, set up your layers like this:

Shading (Multiply)
|
+---- Content (Normal)
|
+---- Fill (Normal)

“Shading” is a layer group. “Content” is the paint layer that you do your shading on, filled with white to begin with. “Fill” is a fill layer that’s fully black, white or some garish color.

You use the “Content” layer to do you shading on as before. Under normal circumstances, it will cover the fill layer entirely and give you the same result as before. If you erase it, the fill layer will be visible through it. That gives you effectively the same behavior as you’d get in SAI with a black fill layer or CSP with a white fill layer. Or you fill it with purple so that you notice easier when you accidentally erased.

1 Like

It’s possible I misunderstood what preventing the removal or additional of alpha value meant. If The group in the below example is flattened the original alpha is lost. The setup allows you add/remove rgb value only.

I split the alpha of some brush stroke, then put the alpha in a group, it doesnt matter where in the group the transparency mask is, and i threw away the rgb from the split layer. I added a random picture, then used the erase layer to remove the top part of shape, and then within the top left portion added gradient in paint layer. The alpha has not changed.

Just for me… which button do you mean?

Lock transparent pixels or alpha, which only works within a group?

I mean I locked the transparent pixels (the checkerboard :chequered_flag:) and could still erase them, which I find funny\buggy, if I want to preserve the transparency I should not be able to erase it and I think it was that way before, but I am not sure. The alpha (@) is working as expected for me. I have to be able to erase my alpha layers, if I want to do my magic on the canvas.

And if I don’t want that layer to stay as is, I lock :locked: it down.

So I have 3 symbols for my layer, which all do something with alpha, lock and transparency so I am confused.