How to Remove Backgrounds using GIMP
One of the most typical tasks of image editors is removing backgrounds to leave transparent frames.
You could be prepping images for photorealistic collages or a website and don’t know where to start with background removal.
Below are four ways you can hack this in no time.
NOTE: The basic procedure of background removal cuts across all four methods.
General Principles of Background Removal using GIMP
Step 1: Open the image you are working on and add an alpha channel.
Step 2: Use a selection to isolate the subject.
Step 3: Hide or remove unwanted background.
Step 4: Save in a format that handles transparency (PNG is the most preferred).
Above are the general guidelines, but there are other ways to tackle each step.
The image you are editing determines most of your choices as each method has different results depending on the image’s structure and content.
So, let us dive into each step and learn various ways you can handle each.
Step 1: Using an Alpha Channel to add Transparency
Most computer images have three color channels – green, red and blue.
Each channel is a grayscale image; however, depending on the channel it represents, the channel color is displayed as a white pixel, and all are combined to form normal images.
To add transparency to an image, ensure it has a fourth channel referred to as an alpha channel.
An alpha channel is a grayscale image; however, instead of it representing blue, green or red, the white pixels it has are considered transparent.
You can add an alpha channel to an image in two ways: opening the Layer menu on the menu bar (absolutely the simplest) and selecting Transparency in the submenu.
Click ‘Add Alpha Channel‘, but the image could have an alpha channel if this option is unavailable.
Immediately you add multiple layers to your image; alpha channels are instantly created because transparency is a vital element of your layer composition and how it works.
Step 2: Use a Selection to Isolate the Subject
This step is the most fiddly and time-consuming of the four, but it will be simpler if you use an image of a plain cube.
Once your shapes become more complex, time investment rapidly grows.
Selecting a single strand of hair at a time can haunt you.
Luckily, some helpful tools can make this process simpler and less stressful.
Combining them and getting desired results without hand-doing everything is also easy.
Hold down the Shift Key to add to your current selection, and the Ctrl Key removes or subtracts.
The Quickest Way to Create Selections
Using the Fuzzy Select Tool is the quickest way of creating selections around a subject.
It is GIMP’s name for the magic wand selection tool that automatically selects pixels within a given color range of the initial color you click on.
For the better part, it is more beneficial if you use it on the right image; however, it quickly runs into trouble.
You can adjust the Threshold Settings under the tool options, which determines the size of the color selection range.
It is the only viable control you can have over your final selection.
Because of how fast it is, it won’t hurt trying it to see if you can use the results.
You can experiment with various threshold options and initial click spots.
It might not work well, but you might get a good starting selection you can refine using other methods.
The Foreground Select Tool
If the first step didn’t give your desired results, you could be lucky with the Foreground Select Tool.
It is an exciting blend of generality and precision and might be pretty challenging to use initially; however, practice makes using it more perfect.
From the toolbox, choose the Foreground Select Tool.
The tool has a fair number of stages but is all simple (GIMP has tooltips on the information panel somewhere in the editing window for more prompting).
Step one is to outline the subject roughly (emphasis on the rough part).
All you want is to define the section where GIMP has to process and press Enter.
The background areas will turn dark blue while the roughly selected areas turn light blue.
The cursor also changes into a paintbrush, and your task will be identifying various colors you need GIMP to outline.
You mustn’t cover the whole subject; only ensure you cover most of the subject’s colors for GIMP to know what you want.
Use the [and] square brackets keys to adjust the brush size if need be, and remember it isn’t a must to precisely follow all the edges.
It is more about directing GIMP the colors in the chosen subject; even the quickest and clumsiest outlining job can give impressive results, but on most occasions, GIGO applies (garbage in garbage out).
So be more careful and attentive during outlining for a tighter and better selection after the tool is done.
Create Selections using Paths
Paths Tool is an alternative method for creating a selection.
It creates Bezier curves onto your image that you can edit and manipulate as much as you want without altering the other image’s content.
Click on the Paths Tool and choose ‘create individual control points’ in the toolbox.
Two points will connect to create a line.
The handles define the shape of the curves you will need, and you can add many points.
Open the ‘Select’ menu and click on From Path.
Paths aren’t the most recommended method, but it is the best option for some people.
For beginners, matching paths to pixelated edges can be trickier to precisely do and give consistent results.
Finishing with the Free Select Tool
Anything could happen, and everything else fails.
The Free Select Tool effectively puts finishing touches on the selection; however, it can be a painstaking and tedious task to do using your hands.
If it gets extremely frustrating, you can skip to the layer mask section below to use brush tools.
Extra Trick: Color to Alpha
If your subject is against a solid colored background, use the Color to Alpha tool to simplify the entire process.
You might have spotted this while adding to the alpha channel.
The tool is in the Layers menu under the Transparency submenu.
The Color to the Alpha tool can entirely remove the white background and also the whole image.
It might not be perfect, but it can be an excellent option.
Step 3: Hide or Remove Unwanted Background Areas
After creating your selection, you are ready to do away with any unwanted content.
You can do this with the Delete Key, and anything you have selected disappears.
The checkerboard pattern defines the transparent section of the image but not the actual image data.
If your selected areas are perfect, head to step w and save your file in PNG format; however, if it could benefit from more work, undo Delete and use a layer mask for refining the selection with the help of paintbrush tools.
Using Layer Masks
Some people use channels as layer masks when creating selections.
Though it helps select finer details like hair strands or pet fur, it can be a hit or a miss.
It doesn’t work well if the image doesn’t have the best color balance.
You can use layer masks for storing and refining the selection for the best results possible.
It can be challenging to know if a selection line will produce acceptable edges; that is why working with layer masks allows for reviewing and adjusting.
In the Layers palette, right-click on the main layer to add a layer mask.
Choose ‘add a layer mask’ and select the new icon in the palette.
The background should still be selected.
Click the Bucket Fill Tool, then fill the whole selection with black.
Black completely hides it.
Using the paintbrush tool, adjust the mask to your preference.
Painting white pixels makes the image’s section opaque while painting black ones makes it transparent.
You can tweak the brush settings as desired.
Step 4: Export the Image as PNG File
You need to save the image file using any format that allows alpha transparency, like PNG (Portable Network Graphics).
PNG is the most typical format that stores alpha channels you can use online.
On the File menu, click Export As then click the + icon next to Select File Type in the bottom section of the Export As Window.
Scroll down to PNG image, name your file however you want, and then click Export.
The last step is configuring any PNG option you want to adjust, but the default settings are okay for transparency storage.
Background removal can be fiddly and very time-consuming.
It can be easy to grasp the basics but mastering the skill in all variations is challenging.
If you try this and everything flows smoothly, pat yourself on the back, but if it gets messy, no worries.
It will take some time to master the tools and use them.
Practice makes perfect in this case!
Super tutorial that I found really enlightening, I actually thought the whole process would take many more than 4 steps to complete. Is the GIMP tool the best option available to perform background removals manually or would you recommend any other platforms?
Do you have a video tutorial available to watch the whole process unfold?