2.8. Selecció del Primer Pla

Figura 14.34. L'eina Selecció del Primer Pla en la caixa d'eines

L'eina Selecció del Primer Pla en la caixa d'eines

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.

2.8.1. Activació de l'eina

Podeu activar l'eina Selecciona el Primer Pla de dues maneres:

  • en fer clic sobre la icona de l'eina en la caixa d'eines,

  • en el menú de la imatge EinesEines de seleccióSelecció del Primer Pla

  • Aquesta eina no té drecera de teclat, però es pot definir fent servir EditaPreferènciesInterfícieConfigura les dreceres de teclatEinesSelecció del Primer Pla

2.8.2. Direcció per l'ús

Let us start with an object distinctly different from background, not needing to be refined.

  1. 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.

    The selection is closed.

    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.

  2. 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 Select button that will be used to create the extraction after marking the foreground.

  3. Dibuixeu una línia en el primer pla: utilitzant el pinzell, la mida es pot canviar a opcions. Dibuixeu una línia contínua en el primer pla seleccionat, de manera que passi sobre els colors que seran utilitzats per l'extracció. El color de la línia no és important sempre que no utilitzeu el mateix color del fons. Compte de no pintar els píxels del fons.

    With this one-color object distinctly different from background, a few strokes are enough:

  4. Toggle preview to verify result.

    [Nota] Nota

    This Preview mask is a mask: you can draw directly on it and see result immediately.

  5. Try Matting Levin engine that may improve result.

  6. When you are satisfied with result, click on Select button to get the selection of the foreground with its marching ants.

2.8.3. Opcions

Figura 14.35. Opcions de l'eina de Selecció del Primer Pla

Opcions de l'eina de Selecció del Primer Pla

Les opcions de l'eina es mostren en una finestra enganxada sota la caixa d'eines quan s'activa una eina. També s'hi pot accedir des de la barra del menú imatge a FinestresFinestres acoblables Opcions d'eines que obre la finestra d'opcions de l'eina seleccionada.

Mode; Feather edges
[Nota] Nota

Consulteu la secció Eines de selecció per obtenir ajuda sobre les opcions comunes a totes les eines de selecció. Aquí només s'expliquen les opcions específiques d'aquesta eina.

Draw mode

Draw foreground: to draw what will be foreground.

Draw background: to draw what will be background.

Draw unknown: to add to your selection pixels that are in background.

Stroke width

The size of the brush.

Preview mask

You can adapt the color of the preview to your image.


Work with Matting global(default) and improve result with Matting Levin.


Default is 1. Repeating algorithm may improve result.

2.8.4. Refining Foreground Extraction

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.

Figura 14.36. Example for Draw background

Example for Draw background

On the left: drawing foreground ill-advisedly went over background area: a part of background will be included in foreground selection!

In middle: Draw background option is checked: draw on inclusion and unwanted pixels.

On the right: unwanted selected pixels in background are no longer in foreground selection.

Figura 14.37. Example for Draw unknown

Example for Draw unknown

On the left: the selection left a small part of foreground unselected, in unknown pixels area.

On the right: with Draw unknown option checked, draw on unselected pixels. They are now selected.