4.2. Align and Distribute

The Align and Distribute 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

Il existe plusieurs possibilités pour accéder à l’outil :

  • From the main menu: ToolsTransform ToolsAlign and Distribute.

  • By clicking the tool icon in the Toolbox.

  • By pressing the Q keyboard shortcut.

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.95. Tool Options for the Align and Distribute tool

Tool Options for the Align and Distribute tool

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 main menu through WindowsDockable WindowsTool Options which opens the option window of the selected tool.

Alignement
Relatif à :

Dans cette liste déroulante, vous sélectionnez la cible, l’objet de l’image sur lequel le calque sélectionné viendra s’aligner.

  • 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 : l’image est la cible.

  • Sélection : la sélection est la cible.

  • Calque actif : le calque actif, dans la boîte de dialogue des calques, est la cible.

  • Canal actif : le canal actif, contenant une sélection effectuée auparavant, est la cible.

  • Chemin actif : le chemin actif est la cible

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.

Exemple

Une image avec une sélection, le calque n°1 (arrière-plan) est actif, le calque n°2 est rogné selon le contenu, le calque n°3 est un calque de texte.

Nous cliquons sur le cercle jaune : le calque n°2 devient la source. Nous voulons envoyer cette source au milieu de la sélection ; l’option Relatif à est fixée sur « Sélection ».

Aligner sur le centre de la cible est cliqué.

Aligner le milieu de la cible est cliqué.

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 distribute sources evenly.

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

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

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

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

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

Exemple pour les commandes « Répartir »

Base image: three layers. Exemple pour les commandes « Répartir » (Distribute right edges of targets) will be used.

Exemple pour les commandes « Répartir »
Active layer is yellow (target). All layers are aligned on the right edge of the yellow layer.

4.2.4. Exemple pratique pour les commandes « Répartir »

Figure 14.97. 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

Nous les sélectionnons comme sources avec Maj + clic.

Image d’origine

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

Image d’origine

After using the Image d’origine (Distribute targets evenly in the horizontal).


4.2.5. Alignement utilisant la sélection élastique

Figure 14.98. 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

« Selection » is the reference. After a click on the Alignement utilisant la sélection élastique button, both layers align with the left side of the selection.