How to remove a background in GIMP

Add an alpha channel, pick the right selection tool for your photo, and export a PNG that keeps its transparency, with notes where GIMP 2.10 and 3.x differ.

Updated

To remove a background in GIMP, give the layer an alpha channel (Layer > Transparency > Add Alpha Channel), select the background, press Delete, and export the result as a PNG with File > Export As. The right selection tool depends on the photo: Fuzzy Select for a plain background, Select by Color for a color that shows up in several places, and Foreground Select for a detailed subject on a busy background. The menu paths here are the same in GIMP 2.10 and 3.x unless noted.

Why the alpha channel comes first

The alpha channel is what stores transparency. GIMP's manual explains that Edit > Clear makes a selection transparent only if the layer has one; otherwise the deleted area is filled with the current background color. A photo opened from a JPG usually arrives as a single background layer without alpha, and in the Layers dialog, layers that lack an alpha channel have their names shown in bold. Add it from Layer > Transparency > Add Alpha Channel, or from the Layers dialog's right-click menu.

Choosing a selection tool

Tool How to open it Best for
Fuzzy Select Tools > Selection Tools > Fuzzy Select, or U A plain, evenly colored background in one connected area
Select by Color Tools > Selection Tools > By Color Select, or Shift+O A background color that also shows through gaps, such as between arms or inside a letter O
Foreground Select Tools > Selection Tools > Foreground Select (no default shortcut) A detailed subject, or a background with many colors

With Fuzzy Select and Select by Color, holding Shift before you click adds to the selection and holding Ctrl subtracts from it. The Mode buttons in Tool Options do the same if you prefer not to use keys.

Fuzzy Select for plain backgrounds

Fuzzy Select starts at the pixel you click and spreads to neighboring pixels of a similar color, and GIMP's manual notes that it often works very well on a solid-colored background. The Threshold option controls how wide a range of colors it takes; you can also click and drag, where dragging down or right grows the selection and up or left shrinks it. Turn on Draw Mask to see the selected area in magenta while you hold the mouse button. If your image has several layers, Sample merged makes the tool look at all visible layers instead of only the active one.

Select by Color for backgrounds that show through gaps

Select by Color has the same options, but it selects every pixel similar to the one you click, wherever it is in the image. That makes it the better choice when the background also appears between a person's arm and body, inside handles, or in the holes of letters. The catch is the reverse: if the subject contains the same color, those parts get selected too, so check the selection before you delete.

Foreground Select for detailed subjects

Foreground Select is built for subjects that a color-based tool can't separate:

  1. Roughly draw around the subject, including a little background, and close the outline by clicking the starting point or double-clicking.
  2. Press Enter, then paint a continuous stroke over the subject; the Stroke width is in Tool Options. Avoid painting over background.
  3. Turn on Preview mask to check the result. Switch Draw mode to Draw background and paint over any background that was wrongly included.
  4. Click Select, or press Enter, to finish.

This selects the subject rather than the background, so choose Select > Invert (Ctrl+I) before pressing Delete. The manual warns that the tool needs a lot of memory on large images, and the GIMP 3.2 manual adds that the Matting Levin engine is temporarily unavailable on Windows; Matting Global is the other engine.

Cleaner edges and white logos

A thin halo of the old background often clings to the edge. When the background is selected, Select > Grow by a pixel or two before deleting takes that fringe with it; when the subject is selected, Select > Shrink does the same job. For a logo or drawing on white, Colors > Color to Alpha (also listed under Layer > Transparency) turns a chosen color transparent and keeps anti-aliased edges blended. It affects that color everywhere on the layer, including white areas inside the logo.

Exporting a PNG

GIMP's Save command only writes its own XCF format, so use File > Export As (Shift+Ctrl+E). Type a name ending in .png, or choose PNG under Select File Type, and click Export; a dialog with options for the format opens, where you click Export again. In GIMP 2.10, that dialog has a Pixelformat setting that by default matches your image, which keeps the alpha channel. Don't export to JPG: it can't hold transparency, which is also why converting a JPG to PNG doesn't make a background transparent on its own.

Doing it in the browser instead

For hair, fur or a busy background, Background Remover PNG can save a lot of manual selecting: an AI model runs in your browser and typically makes the cutout in a few seconds on a recent computer, free and without a signup. The image is processed on your own device, and you download a full-size transparent PNG that you can open in GIMP for further edits. For the whole process of checking and fixing edges, see how to make a background transparent.

How to remove a plain background in GIMP

  1. Open the image and choose Layer > Transparency > Add Alpha Channel.
  2. Pick the Fuzzy Select tool with Tools > Selection Tools > Fuzzy Select, or press U.
  3. Click the background. Hold Shift before clicking to add more areas, or Ctrl to remove areas from the selection.
  4. Press Delete, or choose Edit > Clear. The background turns into a checkerboard, which means it is now transparent.
  5. Choose Select > None and zoom in to check the edges.
  6. Choose File > Export As, give the file a name ending in .png, click Export, then click Export again in the PNG dialog.

Frequently asked questions

Why does GIMP fill the area with white instead of making it transparent?

The layer has no alpha channel. Without one, Edit > Clear fills the deleted area with the current background color, so undo, choose Layer > Transparency > Add Alpha Channel and delete again.

What is the difference between Fuzzy Select and Select by Color?

Fuzzy Select spreads from the pixel you click to connected pixels of a similar color. Select by Color picks every pixel of a similar color anywhere in the image, which also catches background showing through gaps.

Why doesn't File > Save give me a PNG?

In GIMP, Save only writes the native XCF format, which keeps layers and is meant for reopening in GIMP. Use File > Export As to create a PNG, and keep the XCF if you may want to edit again.

My PNG came out with a white background. What went wrong?

Usually the image was exported as a JPG, which cannot store transparency, or the alpha channel was never added. Check that you see the checkerboard in GIMP, then export again with a .png file name.

Why is Foreground Select so slow?

GIMP's manual warns that the tool needs a lot of memory and can slow down or crash on large images. It suggests switching the Engine to Matting Global, or raising the number of Levels, which is faster but uses more memory; both are a little less accurate.

Are the steps different in GIMP 3?

The menu paths in this guide are the same in GIMP 2.10 and 3.x. One difference is that in 3.x, Add Alpha Channel applies to all the layers you have selected, not only one.