How To Remove a Background In GIMP {+ Retain Fine Hair Details}



Removing a background in GIMP is easy. Once you know the steps, of course. But, I didn’t want to create just any ‘ole background removal tutorial.

I wanted to give you a challenge… remove a background AND retain fine hair details, like “stray hairs.”

Now that’s a challenge. Wouldn’t you agree?

Once you’re done with this GIMP tutorial, you’ll not only know how to remove any kind of background but how to do it for complex situations too.

If you prefer watching, check out the Youtube video I provided above. I explain, step-by-step, how to switch the background for a new one, and how to keep her hair intact.

Table of Contents

Note: the (above) video tutorial was created with GIMP beginners in mind. The following step-by-step instructions are for more experienced users.

Step 1: Download the Provided Image & Open In GIMP

download and open image

This is the easiest part of this tutorial. Download this photo and open it in GIMP. That’s it. Let’s move onto step 2…

Oh, and if you’re watching the video tutorial (above) here is the second image.

Step 2: Select the Background

Before you can remove the background, you have to make a selection of it! We have several selection tools in GIMP that can get the job done. Like, the Fuzzy Select tool, Magic Wand, Quick Mask Mode, and more.

However, I think the Foreground Select tool is the best one to delete the background for this project. AND to keep as much of her hair intact as possible. Here’s another tutorial that uses the Foreground Select tool too.

Activate the Foreground Select Tool & Apply


Selecting your background with the Foreground Select tool has a few steps. First, grab the tool from the toolbar.

If you’re using GIMP 2.10.20 or newer, it might not be visible. That’s due to tools now being nested with similar tools. You can find it with the Free Select tool. Or grab it from your menu; Tools > Selection Tools > Foreground Select.

Next, in the Tool Options, make sure under “Draw Mode,” you have the “Draw background” option selected. Now, make a rough selection around her by drawing close to (but not on) her hair and body.

It doesn’t have to be perfect. Refer to the image above to see my initial selection.

Now, hit Enter or Return to apply the first step. This will add two blue colored overlays. The dark blue color represents the background, and the foreground is the lighter blue.

Set the Foreground

start foreground select tool

We now need to tell GIMP where the foreground is. This time, instead of drawing, we’ll paint where the foreground is selected. By default, once you see those blue overlays, GIMP auto-activates a brush for you.

There are two things you’ll need to do before applying the brush.

  1. Go to the Tool Options and select “Draw Foreground.”
  2. Increase or decrease the brush as you paint on your subject (foreground).
As you did with the background selection, it doesn’t need to be perfect. Paint along the inside edges of our subject with a decent size brush. Unlike resizing your brush with a regular brush, this brush is resized via the Tool Options with the “Stroke width” slider.

For this image, a stroke width around 250 is perfect for the initial outline. Once you’ve completed that, increase the size to around 500 -600. This allows you to fill in the rest of the area a lot quicker.

Once you finished that, hit the “Select” button, and GIMP will do its magic! After the calculations are done, you’ll be left with your selection… it’ll look like marching ants.



As you apply the brush on the inside, the original image will show through as the light blue overlay is removed. If not, you forgot to change to “Draw Foreground” in the tool options.

Pro Tip:

How the Foreground Tool works. As you target the foreground & background, you’re giving GIMP an idea of where each is located within your image.

GIMP will then take the data, like the details, contrast, colors, etc., to determine where the background and foreground are! This is magically done with its built-in algorithm. Although GIMP does a pretty good job initially, it’s not 100% accurate.

Most of the time, you’ll need to fine-tune the selection with another Selection tool. My favorite for achieving this is by using the Quick Mask Mode.

Step 3: Remove the Background

remove background

Here is the moment you’ve been waiting for… removing the background! Here are the steps to complete the removal…

Hit the “Add” button, and BOOM! The background has been removed, and you have a transparent background.

Pro Tip:

Some GIMP tutorials (created by others) require the addition of “add alpha channel.” Making a Layer Mask with “Select” eliminates the need to add an alpha channel.

Step 4: Replace the Background With a New Image Background

replace background

Either find your own image or download this forest image I’m using. Once downloaded, locate the file on your computer and drag/drop over your GIMP interface.

This will add the image as a new layer! Now, click and drag the layer below the portrait layer. Boom! You now have a new background.

The only problem is her hair is a bit pixelated. This could have been avoided (somewhat) by feathering the selection. When I tried feathering the selection for this image, I didn’t find that it helped much. 

Sometimes it helps, and sometimes it doesn’t. It depends on the photo and its resolution.

This leads us to the next step, where you’ll learn how to smooth out the image’s pixelization and retain most of the hair detail.

Pro Tip:

How to feather the selection, and what does it mean?

Feathering a selection simply means making the selection smoother along the edges. This helps reduce pixelization in the image… depending on the strength applied.

To feather a selection, go to Select > Feather and start with a strength of 2 – 5px.

Step 5: Final Edits In GIMP To Retain Hair Detail

Before we can work on the hair edits, let’s deselect our selection with; Cmd. or Ctrl. + Shift + A. Or via the menu; Select > None.

Here are the first steps for this part of the edit…

  1. Duplicate the portrait layer with its layer mask.
  2. Right-click on the duplicate layer and select “Apply Layer Mask.”
  3. Add a new “white” layer mask.
  4. Turn off the original portrait layer and mask (click on the icon to the left).
When it comes to this editing step, there is no one right tool for the job. You’ll have to experiment with different tools to see how to achieve your creative vision.
My tools of choice for this kind of edit are the Smudge Tool (S), Eraser Tool (Shift + E), Brushes (P), and the use of the Layer Mask to adjust the edits.

Hair Detail Retention Part 1

fix background

The first thing I’m going to do is remove the background remnants from the original background. These are easy to see since they’re in larger chunks around the hair and her lower body.

I’ll paint with black to remove these larger pieces located outside her hair and body. Make sure to use a soft-edge brush too.

Get in close to the hair and try not to erase too many strays. We want this to look as natural as possible without giving her a flat head.

Hair Detail Retention Part 2

Next, move inside her hair where the old background is still visible. Also, switch to the Brush tool and click on the Layer Mask. Plus, adjust the following in the Tool Options…

Apply a smooth, long stroke the length of the area that needs to be removed. You’ll need to do this several times to slowly delete the background.

This helps keep some of the hair as you delete the unnecessary parts.

Oh, and adjust the brush size for each new area you’re working on too. You might also need to make adjustments to the Opacity and Force for the best results.

Hair Detail Retention Part 3

fix hair

The stray hairs located near the top of her head appear much darker than others. This is due to GIMP not being able to precisely decipher the background from the foreground. Most likely, due to the thinness of some hair.

It’s not necessary to keep all the stray hair. Just enough to make it look natural. So, let’s blend in these darker strays with our Smudge Tool. As we did with the Brush tool, lower the Opacity and Force accordingly.

Apply the Smudge tool as needed to fulfill your creative vision.

Bonus Step: Add More Hair!

For bonus points, you can add more hair to the image. How? With a brush, of course. So far, I’d rate this GIMP tutorial as advanced.

Adding hair is an art form all by itself and is more complex vs. what we’ve done thus far.

Here are a few tips for creating hair…

If you’d like a full GIMP tutorial on adding hair, let me know in the comments below.

What's Next?

Now that you know how to remove a background in GIMP, with a complex one, you shouldn’t have any trouble removing any kind of background. But, it will take practice to master this type of edit.

Looking for another editing challenge? How about removing anything from GIMP?

When you’re done practicing with the image provided, I’d love to see your final edit. Join the friendliest, private group this side of the Milky Way to share your new skills, ask questions, and learn more about editing.

Oh, and check out my Youtube channel too.

Like this article? If so, please share!

7 Responses

  1. Great video and explanation. Thank you! One quick question: when lowering the opacity of the brush to make fine adjustments, the entire subject becomes transparent. It seems that the brush opacity is affecting the cut out subject. What am I doing wrong? Thanks again!

  2. I am using Gimp v. 2.10.24 this is the first time I have ever tried to use such a program as this. Your tutorials are the best very easy to follow. However with my version of Gimp some of the things you do look very different from mine, but I was able to eventually get my project done. Wish I could attach the photo so you could see what I did. I am 81 so for me this is a huge accomplishment. May seem like nothing to some but I am very pleased with the way it turned out. I would also like to know if you have a video showing how to restore color to a faded old photo. Thank you and keep making videos they are a tremendous help. Charlie

  3. Hi Chris. Thank you very much for helpful tutorial. I’m using your other tutorials about Gimp and Darktable on Udemy but now I need exactly what you’re presenting now – remove and/or replace background. I can successfully repeat all the steps with sample photo but I need an advice how to select *more than one* object from the image. Let’s say I have a graphics (not photography) with almost uniformly coloured background and several well-separated objects like butterflies, birds etc. When I select first object as foreground as in your tutorial, I can’t find a method to *add* next objects and make a single mask with all objects included. Could you please give me some advice (text description or addendum to your video)?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.