1

I would like to center text vertically and horizontally in an image within Gimp.

I have the image, I have added the text, I have been able to use the alignment tool to center the text horizontally, but it remains at the top vertically.

The test image has one layer with a simple image in it and when I added the text, it created another image. I aligned the text thing (object? box?) so that it covers the whole image.

Any guidance would be appreciated.

2

While editing the text

  1. add two guides that cross at the center of the canvas

  2. while you are using the Text tool depress AltCtrl and drag the text: a small cross will appear over the center of the layer. Move the layer so that this cross snaps on the intersection of the two guides.

After editing the text

You can always reposition the layer using the usual tools, either the Move tool and guides as above, or using the Align tool.

Notes:

  • All these tools work with the boundaries of the layer, not with the text inside it: a layer with TTTT and one with ____ have the same boundaries, but they won't look visually centered if you just center the center of their layer. But this is more a problem with vertical centering, horizontal centering is usually OK.
  • This of course assumes that you keep the text layer at its initial size as produced by the text tool, if you enlarge it to fill the canvas, then Gimp cannot tell where the text is in the layer.
  • If you are sure that you won't edit the text further (or if you make a copy of the layer and hide it for backup purposes), you can use Layer>Autocrop layer to shrink the layer boundaries to just fit the text. Then the Move/Align tools will work using the visual boundaries of the letters. But even this may not be perfect in some cases, see for instance many fonts where round letters (O,C,S,...) extend slightly below the baseline.
  • Thank you! I didn't actually end up doing it the way you suggested, but your second bullet gave me the clue. I was thinking that alignment would align the text within the textbox, and so I was making the textbox the size of the image. Once I don't do that, then the align tool works. – Jack Dec 10 '18 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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