How to Center a Layer to a Selection in GIMP

This guide explains how to quickly align an image layer to the exact horizontal and vertical center of an active selection using GIMP's Align tool. By switching the tool's reference mode from the default setting to the current selection, you can achieve pixel-perfect centering of any layer within a defined area in just a few clicks.

Step 1: Create Your Selection

Use any selection tool—such as the Rectangle Select Tool (R) or the Ellipse Select Tool (E)—to draw an active selection on your canvas where you want the layer to be centered. Ensure the "marching ants" outline is visible.

Step 2: Activate the Align Tool

Select the Align Tool from the Toolbox, or press the keyboard shortcut Q.

Step 3: Change the Reference to "Selection"

Look at the Tool Options panel (typically located beneath the toolbox on the left side). Find the dropdown menu labeled Relative to: and change it from First item (or Image) to Selection. This instructs GIMP to align your target relative to the active selection boundaries rather than the entire canvas.

Step 4: Select the Target Layer

Click directly on the content of the layer you want to align in the main image window. Once clicked, small square handles will appear at the corners of the layer, indicating that it is active and ready for alignment. Alternatively, you can select the layer in the Layers dialog and click on it on the canvas.

Step 5: Center Horizontally and Vertically

In the Tool Options panel under the Align section, click the following two buttons:

  1. Align center of target (the icon showing a rectangle centered horizontally between two vertical lines) to align the layer horizontally.
  2. Align middle of target (the icon showing a rectangle centered vertically between two horizontal lines) to align the layer vertically.

The selected layer will immediately snap to the exact horizontal and vertical center of your active selection. You can now press Ctrl + Shift + A (or Cmd + Shift + A on macOS) to deselect the area.