mypaint
mypaint copied to clipboard
[Feature Request] Anti-Eraser painting mode
This is the painting mode opposite to Eraser.
By the idea it should work exactly as Eraser, in exception it should increase alpha (till 1.0) instead of decrease.
Please raise this as an issue against the brush engine, libmypaint, as well. You will need to provide us with an algorithm, or a pointer to somewhere that it's implemented already, and kindly link back to this request using mypaint/mypaint#407 type notation so that they can be looked at together. There will be UI work for MyPaint.
Leaving this request open as a UI request, but this needs support in the brush engine first.
.. It's implemented in GIMP.. AFAIK it's literally what loentar says: Eraser subtracts from alpha, Anti-Erase adds to it. There is no effect on color. Implementation here
Not exactly as GIMP. GIMP just adds opacity, even if the area is totally transparent.
I'd like to increase opacity only if pixel's alpha > 0. If alpha = 0 don't change it.
Please see what I mean. The right half of image is after applying anti-eraser, solid rectangle brush with 50% opacity.

The same image on checker pattern to see opacity.

Please report this at https://github.com/mypaint/libmypaint/issues as well.
As long as MyPaint stores colors in pre-multiplied alpha, GIMP-style anti-eraser is not possible: the color information is multiplied by zero in places where the alpha is zero, so there is no way to recover it. But increasing the alpha as suggested should be possible as long as you don't overdo it. It could work by applying a gamma curve to the alpha channel (or anything else that doesn't amplify the alphas close to zero too much). The sharp edge in your "expected" image is probably not achievable without visible color noise and/or banding around the edges, especially after a save-load round-trip through 8bpc.
(Premultiplied alpha has the nice (IMHO) property that only visible information is stored, e.g. there is no hidden image behind every layer which could influence blending or smudging tools by bringing back colors that have long been erased.)
Consolidated into #1219