Post Reply 

Having Trouble Removing Backgrounds

Aug 7, 2014, 00:51
Post: #1
Having Trouble Removing Backgrounds
New Gimp user here and although I've found a way to remove the white background behind an object, the object comes out with the jaggies after doing so.

Here is my newb process:

1. Select white background with Fuzzy Select tool.
2. Delete selection

That didn't work as it left jaggies. So I tried this:

1. Select white background with Fuzzy Select tool
2. Invert selection (so shirt is selected)
3. Select | Feather 5px
4. Invert selection (so background is selected again)
5. Delete selection

Although that gets rid of the jaggies on the shirt, it leaves in its place a weird blur to the line of the shirt instead. It still doesn't look like the original shirt.

How do I fix this?

Here is a sample image which is similar to what I'm using. The white background needs to go. How do I do this and still have the edges of the shirt look like it did in the original image?

[Image: optima_tshirt_zps2c540889.jpg]
Find all posts by this user
Quote this message in a reply
Aug 7, 2014, 01:07
Post: #2
RE: Having Trouble Removing Backgrounds
Have a read of this thread. Smile
Find all posts by this user
Quote this message in a reply
Aug 7, 2014, 06:49
Post: #3
RE: Having Trouble Removing Backgrounds
(Aug 7, 2014 01:07)fluffybunny2 Wrote:  Have a read of this thread. Smile

This works very well when the background is uniform, but in this particular case it is not, because there is a faint shadow. So one has to be rather careful when doing the wand select, the threshold should be chosen to include the shadow but none of the T-Shirt. 136 seems to be a good value here:

[Image: htVHhh2.png]

Note to OP: as you can see this method has the advantage of keeping the shadows...

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 7, 2014, 21:03
Post: #4
RE: Having Trouble Removing Backgrounds
(Aug 7, 2014 06:49)ofnuts Wrote:  This works very well when the background is uniform, but in this particular case it is not, because there is a faint shadow. So one has to be rather careful when doing the wand select, the threshold should be chosen to include the shadow but none of the T-Shirt. 136 seems to be a good value here:

[Image: htVHhh2.png]

Note to OP: as you can see this method has the advantage of keeping the shadows...

So...how exactly did you do this? If you select the background and only use the wand + delete selection, you get the jaggies on the shirt. How is it that yours is smooth?
Find all posts by this user
Quote this message in a reply
Aug 7, 2014, 22:32
Post: #5
RE: Having Trouble Removing Backgrounds
Did you experiment with the Wand tool's Threshold value as ofnuts suggested?
Find all posts by this user
Quote this message in a reply
Aug 8, 2014, 18:35
Post: #6
RE: Having Trouble Removing Backgrounds
I tried to go by the tute that you gave me but it gets confusing as it talks about 3 different methods to do this.

I tried to use the 'Color Erase" method but it didn't work for me. Here's what I did:

1. Selected white background with Fuzzy Select.
2. Used Bucket tool with Color Erase on background

Selection was still jaggie.

I even applied the Select | Grow by 1px and that didn't help either.

Am I only supposed to be using 1 layer for this? What am I doing wrong?
Find all posts by this user
Quote this message in a reply
Aug 8, 2014, 19:58 (This post was last modified: Aug 8, 2014 20:08 by ofnuts.)
Post: #7
RE: Having Trouble Removing Backgrounds
You overlooked the most important part. Once you have a selection on the border of the T-shirt, use Select>Grow by 2px to make it include the edges of the T-shirt (because this is where the important stuff happens).

- Wand select on background (120)
- Select>Grow 2px
- Bucket-fill -> color erase with white

[attachment=3853]

Color-To-Alpha and Bucket-fill in color-erase mode are essentially the same thing.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 8, 2014, 20:02
Post: #8
RE: Having Trouble Removing Backgrounds
By the way, things are not always as clean as they look. Here is what the "white" of the picture looks like (slightly "enhanced" here):

[attachment=3854]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 12, 2014, 00:08 (This post was last modified: Aug 12, 2014 00:13 by Fiction.)
Post: #9
RE: Having Trouble Removing Backgrounds
(Aug 8, 2014 20:02)ofnuts Wrote:  By the way, things are not always as clean as they look. Here is what the "white" of the picture looks like (slightly "enhanced" here):

What am I looking at here and what causes that "ring" pattern on the white background?

Find all posts by this user
Quote this message in a reply
Aug 12, 2014, 09:47
Post: #10
RE: Having Trouble Removing Backgrounds
This is your original image, with a bit of "Curves" trickery to exacerbate the actual level differences in the whites in the background. If the background was uniform, "Curves" would have changed all pixels to the same value and there would be nothing to see. In practice this means that there is a slight radial gradient in the background of the original image (plus two patches in the corners likely where something was deleted by painting it over with white).

In your case it's not much of an issue (but you'll discover that after Color-erase or C2A your background isn't 100% transparent).

But it shows that random images from the web should be scrutinized before being used, even when they look good.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Trouble "cartoonifying" drawing hbabbcook 1 76 Jul 16, 2017 09:09
Last Post: ythgilb
  Removing water spots Robin43 3 174 Sep 27, 2014 02:00
Last Post: iForStyle007
  removing flash glare kevin32 7 1,278 Sep 12, 2014 16:43
Last Post: iForStyle007
  trouble cropping active layer bugsinherteeth 5 255 Sep 4, 2014 20:37
Last Post: fluffybunny2
  Removing Text from a Graphic Image Minnie 8 489 Jul 31, 2014 20:21
Last Post: Minnie

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS