GIMP 3 Cutouts: Clean Backgrounds, Undoable Filters, Proper Exports
Cut an object out of a messy photo, tweak its colors as often as you like and save it so the transparency actually survives.
You want to sell an old desk lamp online. The photo is fine, the lamp looks great, but behind it sits your kitchen: a fruit bowl, a dish towel, half a toaster. Marketplace listings with a clean, transparent or white background look more trustworthy. In GIMP 3 that job takes about ten minutes, and the new non-destructive filters mean you can change your mind about the colors later without starting over.
Everything here applies to the GIMP 3 series. The current release on UpdateStar is GIMP 3.2.6.
Stage 1: Prepare the layer
Open your photo with File > Open. A fresh JPEG has no transparency, so GIMP has nowhere to store "see-through" pixels yet. Fix that first:
- Open Layer > Transparency > Add Alpha Channel.
- Check the Channels dialog if you are unsure: besides Red, Green and Blue there should now be an entry called Alpha.
If the menu item is grayed out, the layer already has one. Good, move on.
Stage 2: Let Foreground Select do the hard part
The Foreground Select tool is GIMP's smart cutout tool. You give it a rough idea, it works out the edge.
- Pick Tools > Selection Tools > Foreground Select. The tool has no default shortcut, but you can assign one in Edit > Keyboard Shortcuts if you do this often.
- Click around your object to draw a rough outline, with a little background inside the line. Close it by clicking the starting point or double-clicking.
- Press Enter (or double-click inside the outline). GIMP turns the outline into a working mask.
- In the Tool Options, make sure Draw mode is set to Draw foreground. Adjust Stroke width so your brush is comfortably smaller than the object.
- Paint a line through the object. It does not need to touch the edges; a confident scribble through the middle and into each part (base, arm, shade) is enough.
- Tick Preview mask to see what GIMP thinks belongs to the object.
- If a piece of the background sneaks in, switch Draw mode to Draw background and paint over it.
- Happy? Click Select or press Enter. You now have marching ants around the lamp.
A note for Windows users: the tool offers two engines, Matting Levin and Matting Global. According to GIMP's documentation, Matting Levin has been temporarily removed on Windows due to crashes, so you will work with Matting Global. Its Iterations setting can improve the edge at the cost of speed. Raise it if hair or fluffy edges look ragged.
Stage 3: Hide the background with a mask instead of deleting it
You could just invert the selection and hit Delete. Don't. A layer mask hides the background instead of destroying it, so any mistake stays fixable.
- With the selection still active, choose Layer > Mask > Add Layer Masks....
- Under Initialize Layer Mask to, pick Selection.
- Confirm. The kitchen disappears and a checkerboard (GIMP's way of showing transparency) takes its place.
- Drop the marching ants with Select > None.
Now look closely at the edges. Missed a bit of fruit bowl? Click the mask thumbnail in the Layers dialog so the mask is active, grab the paintbrush and paint black where something should vanish, white where something should come back. Press D for the default black and white colors and X to swap them. Because you are painting on the mask, the actual photo pixels stay untouched.
Stage 4: Adjust colors with filters you can still edit
This is the big change in GIMP 3. Most filters from the GEGL family, Curves included, are now applied as layer effects. They look applied, but you can reopen, hide, reorder or remove them at any time.
- Make sure the layer itself (not the mask) is selected.
- Choose a filter, for example Colors > Curves, and brighten the lamp a little.
- At the bottom of the filter dialog you'll see a Merge filter checkbox. Leave it unticked. Ticking it gives you the old GIMP 2.10 behavior, baking the result into the pixels.
- Click OK.
Leave Merge filter unticked, then manage your effects from the fx icon next to the layer.
An fx icon now appears next to the layer in the Layers dialog. Click it and the Layer Effects dialog opens. From there:
- Select an effect and use Edit Layer Effects to reopen its settings.
- Click the visibility button next to an effect to switch it off and on for a quick before-and-after.
- Use the up and down buttons to change the order when you stack several effects.
- Remove Layer Effects deletes the selected one.
- Merge Down bakes all effects into the layer for good. If you regret it straight away, Edit > Undo Rasterize filters brings them back.
You rarely need Merge Down. Exporting takes care of that automatically, as the next stage shows.
Stage 5: Save the project, export the picture
This trips up nearly everyone who comes from other programs. In GIMP, File > Save only ever writes GIMP's own XCF format. That file keeps your layers, the mask and every editable effect. Save one, always. It is your undo button for next week.
The file you upload is created with Export:
- Choose File > Export As... (Shift+Ctrl+E).
- Type a name ending in .png, or expand Select File Type and pick PNG from the list.
- Click Export and confirm the PNG options with the defaults.
Why PNG? It stores the alpha channel, so the background stays transparent. JPEG has no transparency at all, which means the cut-out areas get filled with a solid color. Fine if you want white anyway, bad if you plan to place the lamp on a colored banner. For photos without transparency, JPEG remains the better choice because the files are much smaller.
Two details worth knowing. First, layer effects are merged during export, even into formats like PSD that know about effects themselves. Only XCF keeps them editable. Second, after the first export, the File menu offers Export to followed by the file name, which writes the same file again with the same settings. If you opened a JPEG and edited it, Overwrite replaces the original file in its own format. Use that one carefully, the original photo is gone afterwards.
Our verdict
Anyone who sells things online, builds slides or makes thumbnails gets real value from these three skills. GIMP 3 finally makes the color work reversible, which takes the fear out of experimenting. The one thing to do today: cut out one object with Foreground Select, mask it, and save both an XCF and a PNG. Next time it will take you five minutes.
