Removing Backgrounds Quickly in the Gimp

After publishing an article about removing backgrounds quickly in Photoshop, many have asked me how to do the same thing with the Gimp. While there is no equivalent to the Extract filter in the Gimp, you can still remove backgrounds fairly quickly. At Linux.com there is a good explanation of some techniques. Here, I will show you how to do it with the Create and edit paths tool.

1. I will use the same test image as the Photoshop tutorial.
maria1.png

2. Use the Zoom tool to magnify the image to where you feel comfortable.

3. Use the Create and edit paths tool and connect the dots. The key is to place the dots where there are changes in the shape of the image.
maria_dots.png

4. Click between the dots you made and move the line so that it curves around the edges. You can use the square handles that appear to further refine the curves.
maria_curves.png

5. Make sure you complete the full path by making a line across the bottom. Use Shift-V to make a selection based on your path, then Cntrl-I to select the inverse. Then Layer->Transparency->Add Alpha Channel. Finally, Cntrl-K to remove the background.
maria_transparent.png

6. Create a new layer and drop in your new background and you are done.
maria_final1.png

If you know of a better and faster way to do this, share your knowledge in the comments.

14 Responses to “Removing Backgrounds Quickly in the Gimp”

  1. AskTheAdmin Says:

    Thanks for the GIMP walk through - again people over @ http://www.askTheAdmin.com love these tips!

    Keep up the AMAZING work!

    One!

  2. helios Says:

    This is good. I have been looking for just this thing. Somehow I thought it would be easier, but what the heck…this will work and it’s exactly what I needed. thanks.

  3. Penguin Pete Says:

    OK, here’s my attempt at posting my URL:

    http://penguinpetes.com/b2evo/index.php?title=gimp_tutorial_popout_photo&more=1&c=1&tb=1&pb=1.

    Also shows masking a subject from a background in prep for making a popout photo effect.

  4. John Says:

    I don’t know of a faster way to do this now, and I don’t know much about the ongoing development with the GIMP, but when GIMP 2.4 is released (the first release candidate has been released - http://www.gimp.org/) there will be an intelligent scissors tool that may make this much easier.

    To see it in action:

    http://www.youtube.com/watch?v=A_FWoD82U_o

  5. Stefan Waidele Says:

    If the background is sufficiently different from the foreground, I get quick results by selecting the background with the color-selection tool and cutting the selection (ctrl-x). In case I select a shade which is also in the foreground, I restore it using crtl-z

    Using this technique until most of the background is transparent, I can get rid of bigger leftovers (in the corners) using the rectangle-selection, and the smaller details with the eraser.

    That was fast enough until now, but I will try your tip the next time I need something knocked-out.

  6. bryan Says:

    Man, this is great, I read your last blog about how to do this in Photoshop then left a comment saying that I wish I knew how to do this in GIMP, and BAM here it is. Now for my next wish, I sure wish I could find a huge bag of money, I’ll be waiting, hahaha.

    Bryan
    http://www.racinsite.com

  7. chanio Says:

    Great!
    If your object is fading over your background it is not so simple to extract it.
    You can use that red dot at the bottom left of your image screen. Press it. See that all is tainted in red? Well, to select your background, you should ‘paint’ with white using your common tools: if you paint it with an irregular brush you might be creating a blured limit between your image and the background, ok? Then select something and use the fill bucket to fill it with white. That means, only cleaning the red taint and seeing the right image.
    After painting all the red tainted image, togle again the red dot and you’ll find the image selected in a way that you’ll be able to clear the background without making a sharp cutting of the continuity of the degradee.
    I hope that this was what you where asking for.
    alberto

  8. Omid Says:

    thanks, but you can use SIOX: http://www.siox.org/

  9. regeya Says:

    1. The GIMP already has intelligent scissors, and imho works better than Photoshop’s.

    2. Photoshop or the GIMP, the way I’ve found to be both the fastest and most reliable is to draw paths, then convert the paths to a selection. It’s only slow and hard if you’ve never drawn paths. Spend a little time with it and you’ll never go back to any dodgy methods using painting.

  10. David Says:

    Shouldn’t you be doing all this on a layer mask, not the original image?

    Destructive editing is bad, mmkay?

  11. Joe Says:

    If you’ve got a good bit of contrast between the foreground and background, you can use a layer mask + the threshold tool to quickly erase the background. This works really well for pulling out a model who was photographed against a solid-colored photo paper backdrop.

    Create a layer mask (Layer > Mask > Grayscale copy of layer, inverted)
    Layer > Mask > show layer mask
    Tools > color tools > threshold.

    Play with the threshold until the subject is all (or mostly) white and the background is black.

    Use the eraser and/or paintbrush to clean up any spots that need it (black spots on the foreground or white spots on the background.

    Now use the “select regions by color tool” and select the background (black) area. Shrink your selection by 1 px and then feather the selection by 2 px. Use the bucket fill tool to fill the background with black to cover the little border you just created.

    Now apply the mask (layer > mask > apply mask) and see your results.

    If nothing else, this can get you 80-90% of the way complete, then use the path tool to pull out the spots that you couldn’t get with the threshold mask.

  12. nic Says:

    Who cares.

    Just tell me who is the girl?

  13. gregory Says:

    Sorry but result looks quite worthless.

    If you change the background then you have to take care of proper lighting and reflexes. Otherwise picture will look unnaturally. Especially if you change the electric light to the sunlight like in this case.

    Also edges must be not sharp. Just look at her hair. On the original photo they look like hair but on the second photo they look like a plastic bucket.

  14. Mohammed Arafat Says:

    My vote will be for Photoshop method.. I agree with Gregory! There is a lot of difference between photoshop way and the gimp way. Amazingly in photoshop the hair areas super perfect. It helped me a lot, to change the background for 5 photos in just 4 minutes. - Thank you!

Leave a Reply


Close
E-mail It