I have multiple objects copied onto separate layers, and I'm trying to align them and stack them up so they are spaced evenly to fit precisely within a given area.

I made a selection to act as a reference, moved all the other target layers to fit within it, and then easily used the Align tool (Relative to Selection) to move the top target to the top edge of the selection box and the bottom target to the bottom edge of the box. Then I used the Align tool to select all my targets and clicked the button whose tooltip reads "Distribute targets evenly in the vertical". But the way this works (apparently) is to divide the selection's vertical size up by the relative sizes of the targets, then place each target at the midpoint of its size division. This virtually guarantees the stack of targets will end up being smaller than it should be to fit within the given selection--the top target is moved down and the bottom target is moved up, leaving a margin above and below the stack.

Is there any way to configure the alignment tool to get rid of this margin and make a vertically distributed stack actually fit exactly within the reference area?

Here are examples.

In the first picture, immediately before the distribution, the stack of targets has exactly the right height, but the elements are not evenly distributed.

Before Vertical Distribution Relative to Selection

In the second picture, after distribution, the stack of targets is evenly distributed, but the top and bottom targets were inset, so now the stack's height is too short.

After Vertical Distribution Relative to Selection

I'm hoping you can tell me how to make GIMP distribute so the stack keeps the correct height but gains even distribution.

2 Answers 2


You can do it by setting a negative Offset Y in the align tool to fix it. Obviously a little trial and error is required to get it exact, or you could use the Measure tool to measure the height of the rectangle more exactly, since this is the value you need to put in the Offset Y.

See example below

enter image description here


The arrange-layer script can do this. Once installed:

  • position roughly the layers in the order in which they should appear
  • create the selection


  • Image>Arrange layers>Spread>Vertically without spaces

enter image description here


  • the script works on visible layers, so you have to make other layer invisible before calling it
  • the script will auto-align the top/bottom or right/left layers against the selection.
  • Thanks! Too bad I can't get there with the tool in the toolbox, but at least with this script I can do exactly the thing I need. Commented Apr 5, 2019 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.