2

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.

0
2

Using both techniques above worked for me.

I had to replace the dimensions in jpg because they were too small.

  1. Add the text box to your image.

  2. Make sure the text box is tight to the text (Rectangle on bottom left corner).

  3. Duplicate the layer by right-clicking on the layer and selecting "duplicate layer".

  4. Select the original layer by clicking on it in the layers list (one below the one you just created).

  5. Goto edit and select "Fill with FG color". Assuming that the FG color is set to the color you want behind your text.

Note: One other great tip I found is to hold shift when you have to move text as this causes the selected layer to move. It is hard to select text because most of it is empty.

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.

2
  • Thanks Billy, do you know if there's an open source option for this? Jun 28 '20 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 '20 at 23:06
1

Add background color to a text box in a photo:

  1. Add the text box to your photo
  2. Go to Edit top Left
  3. Click on Add FG Color from the dropdown menu.
  4. Select your preferred color.

Done.

2
  • What version of The GIMP are you using. I am rocking version 2.8.14 and the stated option is not available...
    – Digger
    May 15 at 21:41
  • Doing this fills the entire photograph with color - not just the text box.
    – Stan
    May 16 at 22:26

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.