0

I want to add some text to an image in Gimp with the Text Tool, such that the background of the text layer (a rectangle) is of a fixed color instead of the default transparent background to make the text more readable.

I can get it to work by duplicating the layer and using bucket then merging layers, or by removing alpha and color mapping, but those methods are cumbersome, and if I want to edit the text further, I have to start from scratch.

Is there a better method where I can just type and have the background the color that I want it and still be able to edit the text freely, i.e. without rasterizing the text first, and have the background of my chosen color automatically resize to the text?

I saw this question: Can I change the default Gimp transparent background to white? but I don't see how to change the fill type of a text layer, which gets automatically created when I start using the Text Tool.

Tested in Gimp 2.10.18.

1

In GIMP text layers don't have a background colour. So, what you want isn't possible.

To have a background you'd need to create a new layer under the text layer, select a rectangle to surround the text, then fill it with colour.

If you change the text, you would need to delete the filled layer, make a new rectangle layer to fit the new text, and fill it again.

There's nothing that will do this automatically in GIMP, unless you can find a script, or write one yourself.

Also note that GIMP isn't designed for text/page layout. It's photo editing software. If you find yourself doing things like this regularly, then perhaps consider using some page layout software instead, where it is possible to create filled boxes and to type text inside them.

| improve this answer | |
  • Thanks Billy, do you know if there's an open source option for this? – Ciro Santilli 郝海东冠状病六四事件法轮功 Jun 28 at 15:47
  • 1
    @CiroSantilli郝海东冠状病六四事件法轮功 Scribus is Open Source page layout software. However, in Scribus a text box will not expand automatically. Text can however be put inside a text frame which can be resized manually, and the text frame itself can have a colour, while the text can have another colour. – Billy Kerr Jun 28 at 23:06

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.