Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
colour to alpha eroding picture's opacity
#1
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]
Reply
#2
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
Reply
#3
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.

   
Reply
#4
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.
Reply
#5
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

   
Reply
#6
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.
Reply
#7
Ok, understood.
Reply
#8
(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 )
   

Tip: Once you've click OK, just Ctrl+F if you need to propagate 1 more pixel and so
Reply
#9
I am not able to locate this option

> add a mask > from selection

Thanks.

Update : got it Smile

My output

   
Reply


Forum Jump: