NZ Photo Info - Photography Tips and Techniques - Photography Directory

Removing Image Backgrounds - Gimp

In 6 easy steps...

There are times when it is desirable to remove the background from images. This tutorial will take you through the process step-by-step using the freely available gimp software. This tutorial assumes you are running the Windows version, but the concept applies equally to other versions of the gimp and other photo editing software such as Photoshop.

The assumption is that you have a basic understanding of how to use the gimp.

There are many ways to achieve this - the method that we will describe here uses the quick mask tool - a fairly quick and precise method that can be mastered easily.

I have selected a simple image with a well defined transition between the image and the background to demonstrate the technique.

This is process is best done on the full size image - don't resize prior to removing the background otherwise you will need to be much more precise and most likely end up with a jagged looking picture.

original seagull

Step 1

Using the lasso tool make a rough selection around the image that you want to remove the background from.

lasso

seagull 1

Step 2

Activate the quick mask tool by selecting the little square at the bottom left side of the main image window. Once selected your image should look something similar to this:

seagull 1

Step 3

Using the pencil tool you will need to shade the background more precisely around your image.

  • This step is best done with the image zoomed at around 200%.
  • Start with a large pencil size around 15 pixels to take you closer to the edges.
  • finish off with a pencil size of 3 pixels to define the edge of your image.
  • This is the most important part of the process and will require attention to detail.
  • Using a black pencil will result in adding to the masked area or background.
  • If you make a mistake don't worry. You can either use "Ctrl Z" to undo your last action or change the pencil to white which will result in removing the mask.

You should have a nicely outlines copy of your image with the background masked.

seagull 1

Step 4

Toggle the quick mask off and copy the image and paste as new. This will result in a copy of your image without the background.

seagull 1

Step 5

You are almost finished. The image just needs a little bit of cleaning up.

Add alpha to the selection - this can be done from the layers tool ("Ctrl l") by right clicking on the layer:

seagull 1

  • Now you want to shrink the selection by 1 or 2 pixels.
  • Invert the selection.
  • Feather the selection by 1 or 2 pixels
  • "Ctrl + k" to clear
  • "Ctrl + Shift + A" to unselect.
  • Save your image.

seagull 1

Step 6

Congratulations you have finished!
seagull Finished

Submitted by Michael (not verified) on Mon, 05/02/2007 - 09:05.

Great tutorial thanks - explains clearly just what I was wanting.

Submitted by photo-info on Mon, 05/02/2007 - 16:46.

Glad that I could be of assistance.

I had a requirement to remove some backgrounds a while back. None of the tutorials that I found really explained things that well.

So I thought, why not document the process to assist others!

Submitted by beyonddc (not verified) on Sat, 23/06/2007 - 19:15.

Thanks! This is exactly what I needed!

Submitted by jade (not verified) on Tue, 04/09/2007 - 11:15.

this was so easy the way u explained things thank u so much i always wanted to no how to remove backgrounds by following your directions it was so easy .. thanks again..

Submitted by Tony (not verified) on Mon, 15/10/2007 - 06:26.

Great. But how can I add a background of my choice? Thanks. Email me at: fatoni_1990@hotmail.com if you know. Thanks in advance! :D

Submitted by photo-info on Mon, 15/10/2007 - 17:24.

Take a look at this article on Replacing the Sky. It may give you some clues.

Basically all you need to do is follow the tutorial on removing the background. Once you have removed the background add a new layer with the background of your choice positioned behind your image.

Submitted by Youthguy (not verified) on Thu, 03/01/2008 - 08:45.

How would you recommend adding a drop shadow to the above image. This is for a print publication we have. I was copying our images (that I removed the background from) and added it back. The original I "grew" by 6 px, then chose Gaussian blur to 6px as well. Is this the best way to do this, or do you know of any easier, better way to do it. Thanks SO much for this tutorial. BTW, I'm saving the finished graphics as png files, as they support transparency and text wraps around the images

Submitted by Anonymous (not verified) on Sat, 19/01/2008 - 08:26.

I have been trying to figure that for months now and never would have done it without your help!

One other thing, what should I save the document as if I want to open it up in Collage Maker? When I try the background (white) still shows.

Thanks in advance!

Submitted by photo-info on Sat, 19/01/2008 - 21:32.

Youthguy,

The drop shadow can easily be achieved by a slight variation of your method. In simplistic terms:

  1. Create a duplicate layer
  2. Apply a Gaussian blur around 10 pixels is good.
  3. Move the new layer right and down by about 5 pixels.
  4. Position the new layer behind the old layer.
  5. Save your image.

Alternatively you can easily achieve by right clicking on your image and using Script-Fu > Shadow > Drop Shadow.

Submitted by photo-info on Sat, 19/01/2008 - 21:34.

Sorry,

I am not familiar with this application.