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


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

I searched for this everywhere, but can't seem to find an answer, even though it has to be a common problem.

I have an object surrounded by a background, in this case the white. But the transition between the background and the object isn't entirely clean. As you can see some of the pixels close to the border are a little darker.
If I change the background or select the object, it will either cut the transition pixels off and make the result seem cut out, or have this thin gray border around the object.

So is there a way to take the slightly darker white-ish pixels from the white background and transfer them to the new background, but not as white pixels but what's darker than white onto the new background?

I don't want to cut all the white inside the object, this is just about the cut-out.

[Image: 9wlqxp6XIH4g.png?o=1]

Thanks


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

If you use the 'free select tool' to remove the background, you can tick 'feather edges' and play with the radius size.


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

(02-16-2023, 07:54 PM)Taylor-eOS Wrote: I searched for this everywhere, but can't seem to find an answer, even though it has to be a common problem.

I have an object surrounded by a background, in this case the white. But the transition between the background and the object isn't entirely clean. As you can see some of the pixels close to the border are a little darker.
If I change the background or select the object, it will either cut the transition pixels off and make the result seem cut out, or have this thin gray border around the object.

So is there a way to take the slightly darker white-ish pixels from the white background and transfer them to the new background, but not as white pixels but what's darker than white onto the new background?

I don't want to cut all the white inside the object, this is just about the cut-out.

[Image: 9wlqxp6XIH4g.png?o=1]

Thanks

Start here


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

(02-16-2023, 08:54 PM)Tas_mania Wrote: If you use the 'free select tool' to remove the background, you can tick 'feather edges' and play with the radius size.

I tried, it always either cuts off borderline pixels or creates a white frame.

(02-16-2023, 09:26 PM)Ofnuts Wrote: Start here

Thanks, I think this was what I was looking for, I just didn't have the right terminology to describe it.

Color erase does some of what I want, but it leaves the borderline pixels that are not close enough to the selected background color. I guess I could color erase again with those colors, but it would be a cumbersome process, going around my entire image border, as the color erase can never touch my object, because it ruins the coloring of the object, if I do paint over it at all.

[Image: dp8dNFB.png]


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

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:

[attachment=9396]

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

[attachment=9397]

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.

[attachment=9398]

Also, the mentioned tutorial shows how to obtain a selection that protects most of your object so that the Color Erase only happens on the edges and leaves most of the object untouched.



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

But the pixels don't become semi-transparent of the object color (brown to the left), but semi-transparent in the old background color (white). And if I paint behind that with new background (yellow), I get a border of leftover white pixels from the old background.


[Image: Ca8c1AV.png]
The semi-transparent border pixels are not of the object color, but of the background color.


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

(02-17-2023, 03:53 PM)Taylor-eOS Wrote: But the pixels don't become semi-transparent of the object color (brown to the left), but semi-transparent in the old background color (white). And if I paint behind that with new background (yellow), I get a border of leftover white pixels from the old background.


[Image: Ca8c1AV.png]
The semi-transparent border pixels are not of the object color, but of the background color.


Can you share a relevant extract of your source image at 100% size (no zoom)?


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

Sure, this is the same area in the original with GIMP saying 100% zoom.

[Image: h5g3HgY.png]

I appreciate the help!


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

OK. Very dirty image. It looks like it has already been extracted once and put on a clearer background, which is why there is this dark rim. You also have some compression artifacts. IMHO the dark rim has to go and you'll have to use a layer mask and some patience.

[attachment=9405]



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

Thanks.
Makes sense. The image was AI-generated, and it might do all sorts of additional processes. As long as I know I don't have to do this with every image, I can do the patient process.