93
(1 vote, average 5.00 out of 5)

A step by step tutorial on how to create a layer mask in GIMP. You can use a layer mask to remove, change or make abackground transparent.
The first step to successfully replacing or swapping out an image background in GIMP, especially one with a lot of fine detail, is to create a layer mask.
In this tutorial, we will learn how to create a layer mask for use in masking the background in order to change or alter said background. This masking technique does require some time to complete, however, the results are quite professional. If you’ve ever tried to remove or alter an image background, you’ve doubtless had some issues doing a clean selection of the image subject – especially around hair, folds or areas with a lot of fine detail. A good layer mask will allow you to retain fine detail, such as hair, folds in clothing and particles.
Let’s get to it!
- Launch GIMP and open your image. For this tutorial, wewill be using this photo: bg_1.jpg.
- From the GIMP main menu, select “Colors>Components>Decompose”.
- From the “Decompose” window that pops up, select “RGB” for Color model and “Decompose to layers”. Click “OK”.
- From the Layers Panel on the right, right-click the “red” layer and select “Delete Layer”. Do the same for the “blue” layer.
- When you are done, you should be left with only the “green” layer.
- From the Toolbox Panel on the left, select the “Free Select Tool”, otherwise known as the lasso.
- To use the Free Select Tool, simply press and hold the left mouse button and trace a contour around the area you wish to select. In this case, we want to select the subject of the photo. Be careful not to get too close – we want to avoid accidentally cutting details from our selection. When you are done, it should look like this:
- Now that we have selected our subject, we want to invert our selection in order to allow us to fill the background (area surrounding our subject) with black. To invert your selection, use “Select>Invert” or Ctlr+I.
- From the Toolbox Panel on the left, select the “Bucket Fill Tool” and in the Bucket Fill properties below, select “Fill Whole Selection”. Make sure your fill color is black.
- Click once in the background area of your photo to fill it with black.
- Now we need to undo our selection. To remove it, “Select>None” or Ctrl+Shift+A.
- From the GIMP main menu select, “Colors>Threshold”.
- Using the slider in the “Threshold” window, tweak your threshold in order to obtain a fairly strong white outline. We will clean this up with our Brush Tool afterwards. Click “OK”.
- Now we are going to clean up our background before proceeding to filling our subject. To clean up our background, from the Toolbox Panel on the left, select the “Brush Tool”. From the properties section below, make sure “Opacity is set to 100% and use the “Scale” slider to scale your brush size up or down whenever needed. Also make sure that your foreground color is black (same as background fill).
- Increase your zoom to 200% or 400%, using the zoom drop down on the bottom left.
- Scroll over your photo and brush over any small white areas that don’t belong to the subject. Everything you paint over in black will be masked when we apply it to our original photo.
- When you are done, it should look like this:
- Now, we change our brush color to white and fill over the entire area of our subject with the “Paintbrush Tool”. Once done, it should look like this:
- This is your completed mask. We will use this as a layer mask in our next tutorial: GIMP – How to remove or alter an image background. You should save this file.
Technorati Tags:
image mask,
subject,
border,
background,
fine detail,
gimp,
colors,
photo,
change,
remove,
alter,
masking
Add this page to your favorite Social Bookmarking websites
Computers & Software -
GIMP Tutorials
Comments
Agreed Paul! However, this particular technique, while a bit involved, allows for selection of fine particles - hair-fur. Quick Mask may be a touch faster but requires a pretty steady hand and I doubt you could retain as much fine detail without spending an equal amount of time zooming and painting your mask in on a near pixel level.
Appreciate your comment!
Regards,
zeke43
RSS feed for comments to this post.