Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Preventing alpha "flooding" with anti-erase
#1
Hello,
My question is:
I have a layer with transparent parts. I'd like to be able to erase its pixels and later anti-erase them (using the Eraser Tool with ALT pressed) without messing the alpha channel. I don't mean to use UNDO. I typically want to anti-erase because it would be convenient for my workflow. When I lay my "anti-eraser" on parts that were formerly opaque, it's all fine.
But the problem is - when I hit parts that were transparent from the beginning, they get covered with black colour.
This is of course logical, because "anti-eraser" covers alpha channel (removes transparency). But if it's by any smart way possible, I'd like to prevent it. I want the "anti-eraser" to never cover alpha channel more than it was originally. If a pixel had, say, 100/255 alpha value, then it'll never exceed that value, so that I could non-destructively erase anything and then bring it back without losing alpha data.
Maybe there's some clever way to achieve that with layer blending modes or layers masks Huh
Reply
#2
I had never used the anti-erased, so I did some tests, and WOWWW, that's not what I expected! Angry

Using the eraser tool in anti mode, remove smooth edge like gradient to transparency with anti-aliasing it become harsh edges like no more anti-aliasing... Angry
Going over the alpha with anti erase checked, just become a plain black brush on the alpha channel Confused
Locking the alpha channel in the layer docker, just forbidden the use of the eraser or anti-eraser on the alpha or not...
If I remove the alpha channel on a layer, I can erase (although the BG will appear which is normal) but I cannot anti-erase!?!?!!!

I would recommend to use mask instead...
May be do an "Alpha to selection" (right click on the layer) before using the anti eraser to "protect alpha" but I don't know how you work, and this will prevent to get back what you already erased if it's transparent... So there is no real purpose to do it

IMHO the anti thing should not behave like that, at least not paint black on alpha (which is a kind of logic, but it should not do it, in all case I don't know the math behind the anti-erase so I should not make suppositions)

You might want to report that behavior to https://www.gimp.org/bugs/ (read that page first) then go there > https://gitlab.gnome.org/GNOME/gimp/-/issues/new ,
Before the report, make screenshot of before and after, explain with separated paragraph to be easily readable, over all prepare your bug report before on your preferred office with how to reproduce the different bugs, be clear in your explanations
You can add a link to this thread in your bug report
Reply
#3
(07-08-2021, 01:17 AM)einstein Wrote: Hello,
My question is:
I have a layer with transparent parts. I'd like to be able to erase its pixels and later anti-erase them (using the Eraser Tool with ALT pressed) without messing the alpha channel. I don't mean to use UNDO. I typically want to anti-erase because it would be convenient for my workflow. When I lay my "anti-eraser" on parts that were formerly opaque, it's all fine.
But the problem is - when I hit parts that were transparent from the beginning, they get covered with black colour.
This is of course logical, because "anti-eraser" covers alpha channel (removes transparency). But if it's by any smart way possible, I'd like to prevent it. I want the "anti-eraser" to never cover alpha channel more than it was originally. If a pixel had, say, 100/255 alpha value, then it'll never exceed that value, so that I could non-destructively erase anything and then bring it back without losing alpha data.
Maybe there's some clever way to achieve that with layer blending modes or layers masks Huh

This is typically what masks are meant for... If you initialize the mask with black or white (ie, not "Transfer current alpha channel") then it works in addition to the layer's alpha channel (so you can make things more transparent, but painting the mask to white restores the initial transparency).
Reply
#4
Want to use the erase tool ?
You can use a duplicate image in a layer group, 
One with a black on white (straight from Layer -> Mask -> Add Mask -> From Alpha Channel)
The other with the mask inverted.

   

If stuck with using the erase tool / anti-erase then use it on the black-on-white canvas. 
Just get that into one minute for imgur: https://i.imgur.com/sBIauVG.mp4

Another way and possibly better in the long run is make a copy of the layers alpha channel 
Channels Dock -> Right Click Context menu -> Alpha channel selected -> Duplicate Channel.
Accept that using anti-erase will make black areas. When complete use the duplicate channel to make a selection. Cut the selection.
A bit long-winded and you do have to be careful as to where you are in the Gimp structure Layer / Channel ....

I can just get that into a minute as well https://i.imgur.com/b6fJmFs.mp4
I have detached layers and channels so they are easily see. No need to do that, but please avoid psuedo-photoshop layouts Wink
Reply
#5
The fact that the anti-erase mode on alpha channel goes black (I suppose it's rgba(0,0,0,0) to > rgba(0,0,0,1) or something alike) gave me an idea   Big Grin  Big Grin  Big Grin
Yes it took time for my bulb to light on Wink , also I was not sure if it could work, then when exported as png, I saw the options,

   

so... get some fun Big Grin
Download and open that png in GIMP then use the eraser with the anti-erase mode on on the transparency(or everywhere)  Cool
(the white dot in the middle is just to be able to see it in the directory)
   
Reply


Forum Jump: