Gimp-Forum.net
How Do I Change a Background Without Cutting Off 'Borderline' Pixels - 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: How Do I Change a Background Without Cutting Off 'Borderline' Pixels (/Thread-How-Do-I-Change-a-Background-Without-Cutting-Off-Borderline-Pixels)

Pages: 1 2


RE: How Do I Change a Background Without Cutting Off 'Borderline' Pixels - Taylor-eOS - 02-19-2023

Is there some sort of way to set a threshold and remove every color on one "side" of that threshold (say the background) and keep that on the other?


RE: How Do I Change a Background Without Cutting Off 'Borderline' Pixels - rich2005 - 02-19-2023

There is not much to work on from that tiny clip and is it a one-off or do you plan on many images to process.

Generally I find the best way is a layer mask and paint out any defects around the edge. However there is the gimp_gmic_qt plugin http://www.gmic.eu which has an interactive extract filter. Goes like this https://i.imgur.com/HrP2gjG.mp4


RE: How Do I Change a Background Without Cutting Off 'Borderline' Pixels - Taylor-eOS - 02-19-2023

(02-17-2023, 09:05 AM)Ofnuts Wrote: But that's exactly the point!!!

Imagine you have a border between a red and a blue area. The pixels on the border have mix of the red and the blue, depending on the subpixel are that would be of each color:



When you do the Color Erase with blue, the purple pixels become  pure red, but semi transparent:



If you then paint over with green in Behind mode, the transparency in the semi transparent pixels red pixels is replaced by green,, so you red/blue pixels are replaced by red/green pixels where the green exactly replaces the blue: you get the smooth edge back, but between different colors.

This does not work. Everything I touch with color erase becomes some different color on top of a new background. In the case of your example above, the green-red mix would combine into a yellow frame that does not look normal next to the red.


RE: How Do I Change a Background Without Cutting Off 'Borderline' Pixels - Ofnuts - 02-19-2023

(02-19-2023, 09:40 AM)Taylor-eOS Wrote:
(02-17-2023, 09:05 AM)Ofnuts Wrote: But that's exactly the point!!!

Imagine you have a border between a red and a blue area. The pixels on the border have mix of the red and the blue, depending on the subpixel are that would be of each color:



When you do the Color Erase with blue, the purple pixels become  pure red, but semi transparent:



If you then paint over with green in Behind mode, the transparency in the semi transparent pixels red pixels is replaced by green,, so you red/blue pixels are replaced by red/green pixels where the green exactly replaces the blue: you get the smooth edge back, but between different colors.

This does not work. Everything I touch with color erase becomes some different color on top of a new background. In the case of your example above, the green-red mix would combine into a yellow frame that does not look normal next to the red.

Which is why I rescinded in my previous post and recommended to use a layer mask.

However, if you use AI-generated images:
  • There are also AI-based tools to remove background
  • Maybe the image can be generated on a transparent background directly by just asking a slightly different question?