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 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 Tools group on the left, select Foreground Select and then press the keys you want to use as shortcut.
→ , open theLet us start with an object that is easy to distinguish from the background and doesn't need to be refined.
Advarsel | |
---|---|
The foreground select tool needs a lot of memory for its processing, depending on the size of the image. It is known to crash or slow down when using larger images. One way to improve this is to use Matting Global instead of Matting Levin. The slow processing speed can be improved by increasing the number of downsampled Levels, at the cost of using more memory. Both of these options also come with the disadvantage of being less accurate. |
The way it works is similar to the Free Select tool. Roughly select the object you want to extract, with a little bit of background around it. To get a more accurate outline, keep the mouse button pressed while moving. To use straight lines for parts of your selection, click and release the button between the start and end points of the straight section.
As soon you click to start drawing the selection, a small window pops up:
Before the selection is finished, only the close button x is active, allowing you to cancel and return to the original image (this can also be done by pressing the Esc key).
To finish the initial selection, it needs to be closed. When the mouse cursor hovers over the dot where you started the selection, it turns yellow. Click this to close the selection. Instead of doing that, you can also double-click to close the selection.
To create the mask from your selection, press Enter, or double-click inside the selection:
The mouse pointer now changes into a Paintbrush icon with a circle. The dark blue area (this color can be changed) shows the background. The lighter area covers the zone you have selected as foreground and a small part of background. Outside the selected area, the dark blue area is called the “Unknown pixels area”.
The options in the small window on top of the image become active:
A Preview mask checkbox that toggles displaying a preview of the foreground extraction status. The same can also be done by pressing the Enter key.
A
button that will be used to create the extraction after marking the foreground.
Now we start the actual foreground extraction process: draw a line through the foreground. The size of the brush can be changed in the Tool Options area. Draw a continuous line over the selected foreground area moving over colors which will be kept for the extraction. The color used to draw the line is not important, but not using the same color as the foreground makes it easier to see. Be careful not to paint background pixels.
With this one-color object, that is easy to distinguish from the background, a few strokes are enough:
Toggle the preview button, or press Enter to verify the result.
Bemærk | |
---|---|
You can draw directly on this Preview mask and see the result immediately. |
When you are satisfied with the result, click the Enter to finalize the selection and finish the foreground selection operation. You can cancel the operation by pressing Esc.
button, or pressNormalt vises værktøjsindstillingerne i et vindue under værktøjskassen, så snart du aktiverer et værktøj. Hvis de ikke gør, kan du få adgang til dem fra billedmenulinjen via
→ → , som åbner indstillingsvinduet for det valgte værktøj.Bemærk | |
---|---|
See Selection Tools Options for help with options that are common to all these tools. Only options that are specific to this tool are explained here. |
Draw foreground: when selecting with a brush, what you draw will be considered part of the foreground, i.e. included in the selection.
Draw background: when selecting with a brush, what you draw will be considered part of the background, i.e. it will be excluded from the selection.
Draw unknown: When drawing on the background, outside the initial selection, it marks the drawn pixels as belonging to the foreground.
The size of the brush to select with.
Color (default): the color of the selection preview mask; the current color is shown in the color swatch. You can change the color by clicking on it.
Grayscale: allows you to see the resulting mask in black and white. This preview is similar to a layer mask. It can be useful in images where foreground and background color are similar and difficult to distinguish. Available since GIMP 2.10.14.
This is the method that will be used to select the foreground. The default is Matting Levin, which usually gives the best results, but you can also try Matting global, especially if processing is slow and you are using larger images.
The number of downsampled levels to use. Higher numbers can improve processing speed at the cost of using more memory. The default is 2 levels.
The number of levels to perform solving. Higher numbers can increase the selection a bit at the cost of slowing down processing. Setting this number higher than Levels has no effect. The default is 2 active levels.
Higher values may improve the result at the cost of being slower. The default is 2 iterations.
In a lot of images, distinguishing what is foreground or background can be difficult. Refining the selection allows you to extract these foregrounds. The procedure steps are the same as above, but, while drawing the foreground, you will often toggle Preview, use Zoom (+ key), switch to Draw background to delete unwanted background areas, and switch between Grayscale and Color preview mode.