Gimp-Forum.net
colour to alpha eroding picture's opacity - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: colour to alpha eroding picture's opacity (/Thread-colour-to-alpha-eroding-picture-s-opacity)



colour to alpha eroding picture's opacity - meetdilip - 09-29-2021

While the colour to alpha tool is very useful to get rid of backgrounds, it also makes the image semi-transparent. Is there anything we can do ?

For eg, if we try to erase the background, it makes the image transparent. I also tried the Erase Background plugin. But it was leaving traces.

[Image: 499-4990591_turkey-thanksgiving-clip-art...art-hd.png]


RE: colour to alpha eroding picture's opacity - rich2005 - 09-29-2021

It all depends on the image being processed. If C2A removes a colour, paint it back in on an under-layer or use the paint tool in behind mode.

For that image, with small areas that tend to remain with some plugins, try fuzzy selecting the BG while adjusting the selection threshold. Gimp 2.10 has a threshold mask which clearly shows the selection and is adjusted by dragging the mouse across the canvas. If (when) that removes too much, then as before, repair the missing sections, (paint mode behind)

Sometime helps if a temporary layer (grey or blue) is under to help spotting the areas to repair.

example: https://i.imgur.com/2QJDmkz.mp4


RE: colour to alpha eroding picture's opacity - meetdilip - 09-29-2021

Yes, dragging with fuzzy select + Draw mask gave me this. Almost 100% good

I will try using a strong colour as a layer under it.

Had no idea about Paint > Behind so far. Thanks.

[attachment=6773]


RE: colour to alpha eroding picture's opacity - Ofnuts - 09-29-2021

To avoid your subject becoming semi-transparent, make a (counter-)selection to protect it:

  1. Fuzzy select the background
  2. Select ➤ Grow by a couple of pixels so that the selection include the edge pixels
  3. Apply Color-To-Alpha
See Background removal or replacement on text, logos and other computer graphics

My ofn-erase-background script automates some of this.


RE: colour to alpha eroding picture's opacity - meetdilip - 09-29-2021

Thanks. @Ofnuts. I heavily rely on the above-mentioned extension by you. Normally it helps me out of tight spots. But this time, there was visible white even after using the extension. Please see

[attachment=6775]


RE: colour to alpha eroding picture's opacity - Ofnuts - 09-29-2021

Yes, I see some transparency on the white band in the feathers... But this likely got included in the selection because the color was close to the contiguous background color. Either use a smaller threshold or fix the selection afterwards.


RE: colour to alpha eroding picture's opacity - meetdilip - 09-29-2021

Ok, understood.


RE: colour to alpha eroding picture's opacity - PixLab - 09-30-2021

(09-29-2021, 08:10 AM)meetdilip Wrote: Yes, dragging with fuzzy select + Draw mask gave me this. Almost 100% good

Let's try to remove that "Almost" Big Grin

I feel that this image was made with a Bézier curve/path, on the original image edges are smooth, but selection pixelate those smooth edges.

There are many ways to smooth them back:
- Median blur on mask
- Save a selection to path and use that path as a new selection (because it's a smooth selection)
- etc..  @rich2005 and @Ofnuts gave you already other options as well

I'll just add one more
For this example I took your #3 post's image and use the "Value propagate" tool, just for you to have another option (and I feel it's a way underrated tool  Big Grin )

> Right click on layer > Alpha to selection
> Select > To path (path are sub pixels, so we do need to get that smoothness sub pixel)
> Select > None
> Path tab > Path > To selection
> add a mask > from selection
> Select > None
(Your mask in the layer stack should be selected by default, but make sure it is selected as we will apply that filter/tool below on the mask)
> Filters > Distorts > Value propagate In the drop-down list mode select "More black (smaller value)"

Below is the split view of before and after/during the filter on a black background (an unforgiving BG for this exercise, which shows best what can be achieved Wink )
[attachment=6776]

Tip: Once you've click OK, just Ctrl+F if you need to propagate 1 more pixel and so


RE: colour to alpha eroding picture's opacity - meetdilip - 09-30-2021

I am not able to locate this option

> add a mask > from selection

Thanks.

Update : got it Smile

My output

[attachment=6778]