> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Make a Transparent Background in GIMP [Step by Step Guide]
- URL: https://itsfoss.com/remove-image-background-gimp/
- Published: 2020-07-05T09:44:33.000Z
- Updated: 2023-09-25T14:11:06.000Z
- Description: Learn how to remove the background of an image and make it transparent using the free and open source Image editor GIMP.
- Author: Dimitrios
- Tags: GIMP 🎨🖌️

Removing the background is one of the most used graphic design procedures. There could be many reasons why you would want to do that.

For example, you don’t like the background, you want to add the image to another background, or you simply want to make the image transparent.

When you make the image background transparent, you can use the colour according to the background of the new image. If you put a transparent image on top of a blue image, the image will now have a blue background. This is quite handy in graphic designing.

While using an online tool like [Canva is easier for this purpose](https://partner.canva.com/LXKOX3?ref=itsfoss.com), not everyone can opt for the premium plan.

And this is where you can use the free and open source tool [GIMP](https://itsfoss.com/gimp-2-10-release/) to remove the background from an image. I am going to show you how to do that step-by-step in this GIMP tutorial.

In a later section, I'll share a CLI tool that could help you remove the background automatically.

## How to Make a Transparent Background in GIMP

![Remove Image Background in Gimp](https://itsfoss.com/content/images/wordpress/2020/07/remove-background-gimp.jpg)

### Step 1: Open up the image as a layer

As I have mentioned before, you need to get used to isolate different images and actions as layers. This tutorial is so simple that if you just open your image, it will still be fine. Although I want to maintain a good habit and open my image as following.

**File -> Open as Layers**

![Open As Layers in GIMP](https://itsfoss.com/content/images/wordpress/2020/06/open-as-layers.png)

Open As Layers

### Step 2: Use the Fuzzy select tool

The Fuzzy Select tool is designed to select areas of the current layer or image based on colour similarity. This tool will help us to select the unwanted background with one click.

![Fuzzy Select Tool](https://itsfoss.com/content/images/wordpress/2020/06/fuzzy-select-tool.png)

### Step 3: Add Transparency

An alpha channel is automatically added into the Channel Dialog as soon as you add a second layer to your image. It represents the transparency of the image.

If your image has only one layer (like our example), this background layer has no Alpha channel. In this case, to Add an Alpha channel.

**Layer -> Transparency -> Add Alpha Channel**

![Add Alpha Channel for making a transparent background in GIMP ](https://itsfoss.com/content/images/wordpress/2020/06/add-alpha-channel.png)

### Step 4: Delete the background

Press the Delete keyboard button to remove the background.

If you have other different coloured regions that you need to remove, click on them and delete them.

**You might have to repeat the steps 2 to step 4 if necessary**. I have to remove the blue background in this example.

![Removing background from image in GIMP](https://itsfoss.com/content/images/wordpress/2020/06/delete.png)

### Step 5: Export the image

To export the image go to File -> Export As, choose PNG file format and click on Export. All done!

![transparent background image created in GIMP](https://itsfoss.com/content/images/wordpress/2020/06/Its_FOSS_transparent.png)

## Advanced tutorial: Removing the complex background of an image in GIMP

If you have a complex background to remove, you need to take a different approach to do your job.

For the second part of this tutorial, I will demonstrate how to remove the background by adding a transparent layer and how to add a layer of your preference.

![Young pup with complex background to remove in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/0.original.jpg)

### Step 1: Add a transparency layer

Once you open your image, **right click** on the image layer and click “**Add Alpha Channel**“. This needs to be done, to ensure that there is transparency at this layer.

![Add alpha channel to image in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/1.-alpha-channel-1.png)

### Step 2: Select the foreground

Next you need to select the foreground by using the foreground select tool. You may wish to copy my settings as shown at the example below and before you start outlining your object make sure that the **draw foreground** option is selected at the settings.

Once you have adjusted your settings, draw a rough outline of your object and hit the **enter key** when done. **Precision is not important at this step.**

![Select the foreground of the image in order to remove the background in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/2.png)

Adjust the stroke width at the settings panel and draw your object by clicking and dragging your mouse, like you paint it with a brush. You can adjust the stroke width near the outline of your object to get a more accurate result.

You can also change the foreground colour prior to selecting the foreground, to be more obvious whilst go through the process. My personal choice is a red colour.

When you release your mouse it should show up like the example.

![Complex background partially removed in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/3-1.png)

### Step 3: Fine tune your selection

You can fine tune the process by selecting the **draw background** option, to adjust the initial rough outline. Again, you don’t need to as far as you can with the precision.

You may need to go a bit back and forth between the **draw foreground** and **draw background** adjustment to minimize the work for the next step. A result as per below will be fine.

Hit the **enter key** when satisfied.

![Fine tune the selection in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/4.png)

### Step 4: Final adjustment

To get a more accurate result, you can refine even further the outline by working with the path nodes. This is what you can also [use to outline text in GIMP](https://itsfoss.com/gimp-text-outline/).

To see the path nodes follow the steps as shown.

- Make sure that you are at the paths dialog
- Click the **selection to path** option
- Unhide the path > Click Ctrl+Shift+A to deselect the path
- Choose the paths tool
- Click on the path

![6](https://itsfoss.com/content/images/wordpress/2020/07/6.png)

**Focus on the outline precision**

Adjust the outline to be nearly tangent to your desired foreground shape.

**To add a node:** To add a node point to a segment, and click where the node you want to be.

**To adjust the outline curvature**: Click the Ctrl key and drag the node. The node handles will be revealed to increase the precision to maximum.

**To delete a node**: Click the ctrl+shift key and click on a node to remove it.

![Make finetuned outline in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/7.png)

When the path is refined to a final shape, click the “**Select from Path**” option.

![Selection To Path for making the background transparent](https://itsfoss.com/content/images/wordpress/2020/07/8-selection-to-path.png)

### Step 5: Add a layer mask

Finally, you need to add a layer mask to “reveal” the transparency, that you created in the initial step.

To add a layer mask, right click on the current layer > Add Layer Mask > Selection and click Add.

![Add layer mask in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/10.2.png)

If you have followed all the steps correctly, the background will now be masked and you can import or create the background that you like.

![Background removed from a complex image in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/10-1.png)

### Step 6: Add a new background

To create a new background, you have to create a new layer. If you are a regular reader of It’s FOSS, you already know how to create a new layer as it is shown in several GIMP tutorials.

As the difficult part is done, I will let you explore different ways to add a new background. If you already have an image that you want to add as a background, you need to open it as layers from the file drop menu, so you don’t have to create the layer manually.

Either way, you may need to re-order your layers to achieve the final result.

My preference for this example is to use the gradient tool, and yes I picked the colours from Ubuntu!

### Final result with complex background removed and replaced by another

![Final result with complex background removed and replaced by another in GIMP](https://itsfoss.com/content/images/wordpress/2020/07/11.dog-ubuntu-colours.jpg)

## Bonus: CLI tool for automatic background removal

Talking about removing background of images, rembg is an awesome utility. It doesn’t offer a GUI front end but have [some decent features](https://github.com/danielgatis/rembg?ref=itsfoss.com#usage-as-a-cli).

With rembg, you can

- Remove the background of images from your local system.
- Remove the background of all images in a folder and save output to a new folder.
- Remove background of a remote image can be removed and saved
- Remove the background of images in a folder can be changed in real-time.

### Install Rembg

Rembg is not available on default repository. You need to install it using `pip`. To set up `pip` on your system, read our dedicated guide on [how to install python and pip on Ubuntu](https://itsfoss.com/install-pip-ubuntu/).

Once pip is installed, use the below command to install rembg.

```
pip install rembg
```

This installs CPU support version of rembg. There is a GPU support version too. To install that, first you need to check if your system supports the `onnxruntime-gpu`. Go to [onnxruntime.ai](https://onnxruntime.ai/?ref=itsfoss.com) and check the installation matrix.

Once sure, use the command below:

```
pip install rembg[gpu]
```

[Rembg](https://github.com/danielgatis/rembg?ref=itsfoss.com)

### Using rembg to remove background

As said above, there are several ways you can use rembg. Some of the most simple and useful ones are described below.

#### Remove the background of a local image

To do this, open a terminal and run:

```
rembg i <path/to/input/file> <path/to/output/file>
```

![Remove Background of an Image that is stored on your local system](https://itsfoss.com/content/images/2023/04/rembg-i.svg)

Remove Background of an Image

#### Remove the background of images in a folder

You may have various images in a folder. Here, rembg can be used to remove the background of all the images in that directory and save it to a new folder.

```
rembg p <path/to/input/folder> <path/to/output/folder>
```

![Remove background of images stored in a folder and save it to another folder](https://itsfoss.com/content/images/2023/04/rembg-p.png)

Remove background of Images in a folder

### Remove the background of images in a folder in real-time

It means as you paste an image to the provided input folder, its background is removed and saved to the output folder.

```
rembg p -w <path/to/input/folder> <path/to/output/folder>
```

![Remove background of images in a folder by watching the folder for changes](https://itsfoss.com/content/images/2023/04/realtime.svg)

Real-time background removal 

### Remove the background of a remote image

If you have an image in a remote location, remove its background and save it to local system using:

```
curl -s <URL of Image> | rembg i > output.png
```

![Remove background of a remote image using its URL, curl and rembg tool](https://itsfoss.com/content/images/2023/04/remote.svg)

Remove Background of a remote image

🚧

Some remote images may not work. Also, you need to [install curl](https://itsfoss.com/install-curl-ubuntu/) to make this work.

There are more ways you can use this tool. Refer to their [official guide](https://github.com/danielgatis/rembg?ref=itsfoss.com#usage-as-a-cli) for more information.

## Conclusion

There are many different ways to add transparency to an image, depending on the complexity of the background. There is not an absolute path to follow for every occasion and the more hours you spend with GIMP the more efficient user you become.

Don’t forget to [subscribe to the newsletter](https://itsfoss.com/subscribe-to-newsletter/) and let me know what you created following this tutorial at the comments below.