Mobile app version of vmapp.org
Login or Join
Cooney243

: GIMP: Center Text in Image This task should be simple but apparently isn't: I want to add a layer with three lines of text to an image; the text needs to be centered vertically and horizontally

@Cooney243

Posted in: #Gimp

This task should be simple but apparently isn't:

I want to add a layer with three lines of text to an image; the text needs to be centered vertically and horizontally relative to the image as a whole.

The web is full of suggestions that I seem to be misusing.

I can create a layer with the text, and autocrop it to just the text, but when I select the layer and choose the align tool the buttons on the align tool are either grayed out or seem to have no effect, whether I select the layer contents or not.

I've been expanding the layer boundary to the size of the image with the contents, but that does not work consistently.

(My goal is to create a set of simple buttons, with a shared element and different text and background for each button.)

(GIMP 2.8.16 on a Mac)

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney243

2 Comments

Sorted by latest first Latest Oldest Best

 

@Holmes874

Workaround:

Write your text in a vector drawing program. If you want to use freeware, Inkscape is installable into Mac, too.

The following procedure is tested only in Windows, where it works ok:


prepare an empty document in Inkscape. In File > Document Properties turn the background to transparent (=checkerboard or a color that has alpha=0)
write your text, center it. If the text has multiple textboxes or decorative graphic objects, create a group
have your image in GIMP, create an empty layer, goto it
select all, copy
goto Inkscape, paste
select all
goto Object > Align and distribute, align the text and the empty photo
goto File > Export PNG image (NOTE: the transparency disappears if you copy in Inkscape and paste in GIMP)
in the export panel determine the selection as the target to be exported, give the filename and export
open the file in GIMP as new layer


If your GIMP image has only one layer and it's otherwise ready, only the texts are missing, you can as well copy your image into Inkscape, add the texts and save.

10% popularity Vote Up Vote Down


 

@Steve758

You have to click on the layer after starting the tool (the tool does not consider the active layer because it l can act on several layers at once). The tool aligns the layer borders so it's best to keep the layers at their original size.

A completely different way of doing this is to add a guide in the middle of the image (Image>Guides>New guide by percent) and use the Move tool. When you move the layer you get cross symbol at its center and this will snap to a guide.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme