Post Reply 

Removing the background of an image

Jan 13, 2011, 15:38
Post: #1
Removing the background of an image
Hi, I'm a total n00b who just started using GIMP. I'm sure this is a very simple issue but I can't find a simple, working tutorial for it.

I am writing a game using Ren'Py and have hand drawn my sprites. When scanned into the computer, each sprite is on a white background (the page.)

I need to remove the background of the image, keeping only the picture of the sprite.

none of the tutorials I use are working out, and I've been sitting here for the last two hours trying to solve this problem. I thought that I had, but when I try to use the images in the game, the background of the white page remains. Angry

Please help me out--how do I remove the background of an image?
Find all posts by this user
Quote this message in a reply
Jan 13, 2011, 16:20
Post: #2
RE: Removing the background of an image
1) add an alpha channel to your layer
2) use colors/color to alpha and use the background color

This makes all the pixels with the background color transparent, and those with a close color partially transparent.

You may want to use a selection to protect white parts inside the sprites. Then:
- select the background with the magic wand,
- grow the selection by a couple of pixels to ensure that the border of the sprite is in the selection (the most important work of color-to-alpha is on the border pixels, so they shouldn't be protected)

Color-to-alpha often works well but there are pathological cases. If it's not enough, post a sample picture.

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
Jan 15, 2011, 07:25
Post: #3
RE: Removing the background of an image
Thank you--seems to have worked! Going to try my sprite in the game now. Smile
Find all posts by this user
Quote this message in a reply
Jan 22, 2011, 15:41
Post: #4
RE: Removing the background of an image
What do you do if the BG has a gradient and you want it transparent?
Find all posts by this user
Quote this message in a reply
Jan 22, 2011, 16:07
Post: #5
RE: Removing the background of an image
I assume this is related to your "Gradient leaves outline" thread? let's continue over there...

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
Jan 22, 2011, 17:10
Post: #6
RE: Removing the background of an image
(Jan 22, 2011 16:07)ofnuts Wrote:  I assume this is related to your "Gradient leaves outline" thread? let's continue over there...

Actually, it is unrelated. I received a logo on a gradient BG that I wanted to change to a transparent one so I could drop it onto any BG color. A friend did this for me (on Photoshop I think), but it left a lot of aliasing artifacts that are too difficult to remove by hand. I discovered a tutorial for doing this clean-up if the background is already transparent, and am happy with it. The problem is changing that gradient BG to transparent without doing a LOT of separate little operations on all the areas.
Find all posts by this user
Quote this message in a reply
Jan 23, 2011, 00:37
Post: #7
RE: Removing the background of an image
There are plenty of tools for foreground extraction:

- magic wand: click and shift-click repeatedly on the background until you have everything selected., and then delete. Or it may be better to use the magic wand on the foreground and then invert the selection
- intelligent scissors
- foreground extraction likely an overkill in your case
- with some logo and background combination, the logo may be isolated in one specific color channel, it appear very cleanly in the color channels in which case, select the channel on which is has got the most contrast, and use channel to selection.
- in the same case one can also use color/decompose (in HSV mode) and then work the Hue image produced with the curves tools to transform it in to a B&W image around the Hue of the color to be extracted, and then copy/paste that into a layer mask.

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
  "Open Image" change default folder and thumbnail view? Dave001 1 49 Aug 15, 2017 19:56
Last Post: ofnuts
  How to wrap paragraph text in an image arun67 0 37 Aug 12, 2017 12:46
Last Post: arun67
  how to blend straight edges into background?? kshaeblue21 1 33 Aug 11, 2017 03:30
Last Post: ythgilb
  Combining gif image to static image help? littlegreendog 1 73 Jul 26, 2017 12:27
Last Post: ythgilb
  Image color vs color picker YalithKBK 1 113 Jul 7, 2017 11:45
Last Post: ythgilb

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS