4.2. Align

Figure 13.97. The Align tool in the toolbox

The Align tool in the toolbox

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 focalised layer has small squares in corners. Various buttons in the dialog allow you to select how the layer will be moved. And you can select the image object (other layer, selection, path...) the selected layer will be aligned on. This object is called target.

4.2.1. Activating the Tool

You can activate the Align tool in several ways :

  • From the image-menu, through: ToolsTransform ToolsAlign,

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

  • by using the Q keyboard shortcut.

4.2.2. Key modifiers (Defaults)

Shift

You can select several layers by holding Shift when clicking the layers.

[Tip] Tip

Sometimes it's easier to choose multiple layers using rubber-banding: click somewhere outside an imaginary rectangular region covering the layers you want to choose. Then drag out that region by moving the pointer, and release the mouse button. Now every layer, which is completely inside the dragged rectangle, is selected.

Note that now there is no target first item the selected layers can be aligned on.

4.2.3. Tool Options

Figure 13.98. Tool Options for the Align tool

Tool Options for the Align 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 image menu bar through WindowsDockable WindowsTool Options which opens the option window of the selected tool.

Align
Relative to:

This is the target - the image object the selected layer will be aligned on.

  • First item: the first selected item when selecting multiple layers holding the Shift key. Note that there is no first item when you select multiple layers using rubber-banding.

  • Image: the image is used as a target.

  • Selection: the minimal rectangular region covering the active selection.

  • Active layer:

  • Active Channel:

  • Active Path:

These buttons become active when a layer is selected. When you click on one of these buttons, you align the selected layer with left edge, horizontal middle, right edge, top edge, vertical middle, or bottom of the target.

Distribute

These options seem to differ from the Related to options only by the possibility to set an offset. This offset is the distance which will separate the selected layer(s) from the target once the alignment is performed. It can be positive or negative and is expressed in pixel. Distribute add this offset to the left edges, horizontal centers, right edges, top edges, vertical centers, or bottoms of targets.

Offset

This entry controls the amount of displacement that could be given to the desired alignment effect (in pixel) regarding the target. The default value is 0; it can be positive or negative.

4.2.4. Example for the Align command

Figure 13.99. Base image

Base image

This image has three layers with different sizes and a rectangular selection. The yellow layer is active.


Figure 13.100. Red layer selected

Red layer selected

Click on red: the red layer is selected, with a small square in every corner.


Figure 13.101. Red layer aligned

Red layer aligned

We chose Selection as a target and we clicked on the Red layer aligned button (Related to). The red layer alignes with the right side of the selection.


Figure 13.102. Distribute with offset

Distribute with offset

We set Offset to -5, we chose Active layer as a target and we clicked on the Distribute with offset button (Distribution). The layer is aligned 5 pixels before the right side of the yellow active layer.


Figure 13.103. Align using rubber-band box

Align using rubber-band box

We clicked left from and above the red layer, and dragged out a region covering the red and the yellow layer by moving the pointer towards the bottom right corner.

Align using rubber-band box

Again, Selection is the target. After a click on the Align using rubber-band box button, both layers aligne with the left side of the selection.