# ofn3-align-layers

## Purpose

This script realigns layers over a reference layer by scaling, rotating and translating them so that two designated points in each layer come to an exact overlap with two designated points in the reference image.

## Usage

The script is invoked from `Layers > Align layers` in the usual image menus.

The script has no parameters, and works from the selected layers and the selected path.

#### Selected layers

These are the layers that are scaled/rotated, the reference layer should not be included. The layers are processed bottom-up.

#### Selected path

The points are beforehand designated to the script as anchors in a path. There are to ways to use this:

- A path with a single stroke, the successive pairs of anchors being used for each layer, the first one being used for the reference.
- A path with a stroke for each layer, the first one being used for the reference (but although Gimp preserves the strokes order, it may be difficult after the fact to tell the order of the strokes)

## Example

- The stars are on the reference layer
- The circles are on the first adjusted layer
- The squares are on the second adjusted layer

- Before calling, the path goes through the two points of the reference layer, then through the two points of the first adjusted layer, then through the two points on the second adjusted layer.

  - Either as a single stroke:
  - Or as multiple strokes:

- Layers are then selected in the layers list:

- After execution, the adjusted layers have been moved/rotated/scaled so that the points overlap those on the reference layer:

#### Note

The script uses the default interpolation method.