This tool lets you extract the foreground from the active layer or from a selection. With GIMP-2.10, selection refinement has been improved. After the selection is made, with its marching ants, you can copy-paste or click-and-drag it to another image used as background, and, inverting the selection, you can can make changes in background.
You can activate the Foreground Select tool in two ways:
by clicking on the tool icon in the Toolbox,
through
→ → in the image menu.This tool has no shortcut, but you can set one using
→ → → → →Let us start with an object distinctly different from background, not needing to be refined.
Roughly select the foreground you want to extract. When you select this tool, the mouse pointer goes with the lasso icon. It actually works like the Free Select tool. Select as little as possible from the background.
When the mouse pointer comes over line beginning, a small yellow circle appears: release mouse button to close selection. While selecting, click-and-drag draws a fuzzy line, drag only draws a straight line.
If the mouse pointer doesn't cover start point, double clicking closes selection with a straight line.
As soon you click to start drawing, a small window pops up:
For the moment, only a little cross is active, allowing to quit: returns to the original image.
Press Enter to create the mask:
The mouse pointer goes now with the Paint-brush icon. The dark blue area (this color can be changed) is for background. The light blue area covers the zone you have selected, on which you will paint to extract foreground. It contains the foreground area and a small part of background. Outside the selected area, the dark blue area is named Unknown pixels area.
Options in the small window become active:
A Preview mask checkbox that toggles displaying a preview of the foreground extraction status.
A
button that will be used to create the extraction after marking the foreground.
Draw a line through the foreground: using the default selected paintbrush, whose size can be changed in options, draw a continuous line in the selected foreground going over colors which will be kept for the extraction. The color used to draw the line is of no importance; not using the same color as foreground is better. Be careful not painting background pixels.
With this one-color object distinctly different from background, a few strokes are enough:
Toggle preview to verify result.
Note | |
---|---|
This Preview mask is a mask: you can draw directly on it and see result immediately. |
Try Matting Levin engine that may improve result.
When you are satisfied with result, click on
button to get the selection of the foreground with its marching ants.Normally, tool options are displayed in a window attached under the Toolbox as soon as you activate a tool. If they are not, you can access them from the image menu bar through
→ → which opens the option window of the selected tool.Note | |
---|---|
See Selection Tools for help with options that are common to all these tools. Only options that are specific to this tool are explained here. |
Draw foreground: to draw what will be foreground.
Draw background: to draw what will be background.
Draw unknown: to add pixels that are in background to your selection.
The size of the brush.
Color (default): you can adapt the color of the preview to your image, clicking on the color swatch.
Grayscale : new in GIMP-2.10.14, to see the resulting mask in black and white. This preview is similar to a layer mask. It is useful in images where FG color and BG color are not very different and limit between them nor very evident.
Work with Matting global(default) and improve result with Matting Levin.
Default is 1. Repeating algorithm may improve result.
In most images, foreground is not distinctly different from background. Refining selection allows you now to extract these foregrounds. Procedure steps are the same as above, but, during drawing foreground, you will often toggle Preview, use Zoom (+ key), Draw background to delete unwanted background extraction areas. You can also work directly on Preview mask.