4.2. Alignement

Figure 14.117. L'outil Alignement dans la Boîte à Outils

L'outil Alignement dans la Boîte à Outils

The Align tool is useful to align the image layers with various image objects. When this tool is selected, the mouse pointer turns to a small hand. By clicking on an element of a layer in the image, you choose the layer which will be moved (with Shift + click, you can choose several layers to be aligned); this focused layer has small squares in corners and is called source. Then buttons in the dialog become active (they remain active during all the GIMP session): they allow you to select the target, i.e other layer, selection, path, the source will be aligned with.

4.2.1. Accès à l'outil

Vous pouvez activer l'outil Alignement de différentes manières :

  • depuis le menu d'image par OutilsOutils de peintureAlignement,

  • by clicking on the tool icon: in the toolbox,

  • ou en utilisant le raccourci-clavier Q

4.2.2. Touches de contrôle (Par défaut)

Shift

Vous pouvez sélectionner plusieurs objets en appuyant sur la touche Maj (Shift) lorsque vous cliquez sur un objet.

[Astuce] Astuce

Il peut être plus facile de choisir plusieurs calques en utilisant la sélection élastique : cliquez-glissez pour dessiner un rectangle englobant les calques voulus et relâchez le bouton de la souris. Tous les calques entièrement inclus dans le rectangle sont sélectionnés.

Notez qu'il n'y a plus maintenant de « Premier objet  » sur lequel aligner les calques.

4.2.3. Options

Figure 14.118. Les options de l'outil d'Alignement

Les options de l'outil d'Alignement

Normalement, les options de l'outil sont affichées dans une fenêtre attachée en-dessous de la Boîte à outils. Si elles ne le sont pas, vous pouvez y accéder depuis la barre de menus de l'image par FenêtresFenêtres ancrablesOptions de l'outil.

Alignement
Relatif à:

In this drop down list, you select the target, the image object the layer will be aligned with.

  • Premier élément : c'est le premier objet sélectionné quand vous sélectionnez plusieurs objets en utilisant la touche Maj (Shift). Notez qu'il n'y a pas de Premier Objet si vous utilisez la sélection élastique.

  • Image: the image is the target.

  • Selection: the selection is the target.

  • Active layer: the active layer, in the layer dialog, is the target.

  • Active Channel: the active channel, containing a selection you made before, is the target.

  • Active Path: the active path is the target.

Boutons d'alignement

Ces boutons deviennent actifs quand un une cible est sélectionnée.

  • Align left edge of target: to align left edge of source with left edge of target.

  • Align center of target: to align center of source on the vertical middle line of target.

  • : Align right edge of target: to align right edge of source with right edge of target.

  • : Align top edge of target: to align top edge of source with top edge of target.

  • : Align middle of target: to align center of source on the horizontal middle line of target.

  • : Align bottom edge of target: to align bottom edge of source with bottom edge of target.

Example

An image with a selection, layer #1 (background) is active, layer #2 is cropped to content, layer #3 is a text layer.

We click on the yellow circle: layer #2 becomes the source. We want to send this source to the middle of the selection: the Relative to option is set to « Selection ».

Align center of target clicked

Align middle of target clicked

Répartition
Boutons de répartition

These options are used when you have several targets and want to arrange them. Here, layers selected with Shift + Click are called « targets » . But they are actually sources. « Relative to » options are active to set the target. These transformations are usually relative to « Image ».

These options work as Align options, but you can can add an offset and new options are available to distribute sources evenly.

  • : Distribute left edges of targets: to distribute left edges of sources on the left edge of the target (the image).

  • : Distribute horizontal centers of targets: to distribute centers of sources with center of the target horizontally.

  • : Distribute right edges of targets: to distribute right edges of sources on right edge of the target.

  • : Distribute targets evenly in the horizontal: to distribute sources evenly horizontally.

  • : Distribute left edges of targets: to distribute top edges of sources on top edge of target.

  • : Distribute vertical centers of targets: to distribute centers of sources with center of target.

  • : Distribute bottom edges of targets: to distribute bottom edges of sources with bottom edge of target.

  • : Distribute targets evenly in the vertical: to distribute sources evenly vertically.

Décalage

This offset can be positive or negative and is expressed in pixels. Distribute add it to the left edges, horizontal centers, right edges, top edges, vertical centers, or bottoms of sources.

Figure 14.119. Exemple pour les commandes « Répartir »

Exemple pour les commandes « Répartir »

Image de base : trois calques. Exemple pour les commandes « Répartir » (Répartir les bords droits des cibles) sera utilisé.

Exemple pour les commandes « Répartir »
Active layer is yellow (target). Offset = 0: all layers are aligned on the the right edge of the yellow layer.
Exemple pour les commandes « Répartir »
Le calque actif est jaune, décalage = 10

New feature in GIMP-2.10

GIMP-2.10 shows relative coordinates (horizontal or vertical) when moving guides and sample points. Coordinates are relative to the start of moving.

4.2.4.  A practical example for « Distribute »

Figure 14.120. Image d'origine

Image d'origine
Quatre calques de texte, de la même taille. Nous voulons les aligner au centre de l'image.


      

Image d'origine

We select them as sources with Shift + Click.

Image d'origine

The default target (Relative to) is « Image ». Offset = 0. We used the Image d'origine (Distribute vertical centers of targets) command.

Image d'origine

Après utilisation de Image d'origine (Répartir les cibles régulièrement sur l'horizontale) avec décalage = 5.


4.2.5. Alignement utilisant la sélection élastique

Figure 14.121. Alignement utilisant la sélection élastique

Alignement utilisant la sélection élastique

Nous avons cliqué en haut à gauche du calque rouge puis glissé vers le coin en bas à droite.

Alignement utilisant la sélection élastique

Sélection est la cible. Après un clic sur le bouton Alignement utilisant la sélection élastique, les deux calques sont alignés sur le bord gauche de la sélection.