I want to change the text in the image below without modifying the background.

enter image description here

I tried cutting the text and filling the gap with a new one, but it doesn't look nice. Is there a simpler way?

  • "But it doesn't look nice" - What does that mean? Could you show the image that you made? Aug 14, 2012 at 6:08
  • It's a GIF, and therefore, there is no concept of foreground/background from a technical POV. It's all one flat image.
    – DA01
    Aug 14, 2012 at 6:20
  • I would make a selection of the background ( that covers the area of the text vertically ) and then stretch it over the text horizontally ( since there is a slight gradient there ) and then write the text again.
    – Joonas
    Aug 14, 2012 at 6:23
  • thanks for the answers . @Ocaso here is the image i made link. Joonas how could i do that ? since i m newbie can u link a tutorial or smth ? Aug 14, 2012 at 6:42
  • You are missing the drop shadow (just search the web for "gimp drop shadow" should give you enough links on how to do that) in your image. That drop shadow and a bright coloured text should give you the desired result. Aug 14, 2012 at 6:52

1 Answer 1


OK, it looks like you have two problems: first, how to get rid of the current text, and second, how to replace it.

First, let's start with your original image:
Original image

Open it in the GIMP. Since it's a GIF image, it will be in indexed color mode. Change it to RGB mode (Image → Mode → RGB) first: many editing tools won't work on indexed color images, and those that do often produce surprising results.

Now, if the yellow background in your image was a single solid color, removing the text would be as easy as picking the color with the eyedropper tool and painting over the text with it. However, the background turns out to be a subtle gradient, as you can see if you equalize the colors (Colors → Auto → Equalize):
Equalized image
It's not even a linear gradient, so you can't simply use the clone tool to copy it from another part of the background. You could use the Blend Tool to recreate a new radial gradient, tuning it until it matches the original, but I'm going to cheat and use the Resynthesizer plugin instead.

The Resynthesizer is an extremely useful little tool for patching holes in images or removing unwanted obstructions. It used to be one of the few ways in which GIMP's feature set beat Photoshop's, until Adobe introduced their own "content-aware fill" tool, which does more or less the same thing.

So, let's start by selecting the text. You could just select a rectangle around it like I did to start with, but I wanted to be tidy and cut away some parts of the rectangle that didn't overlap with the text. Just make sure the selection covers all the pixels that the text touches at all:
Selected text
If in doubt, it's better to make the selection too big than too small. At this point, we can also feel glad that the original image wasn't in JPEG format, since then you'd have to deal with compression artifacts around the text.

Now, you could either use Filters → Enhance → Smart remove selection... or just Filters → Map → Resynthesize... directly. I went with the latter, since it's such a small image, used the default settings and got this result:
Image with text removed
Let's see how it looks equalized:
Image with text removed, equalized
Not quite perfect, but not bad either. We could hand-tune the gradient further, but honestly, it's nearly invisible anyway.

Now, next we need to recreate the text. It's a good idea to first try to recreate the original "Repair" text as closely as possible, and only then change it to what we want to say.

Knowing the original font would help a lot. It looks like it might be Arial, which I don't happen to have on this Linux box, and in any case Linux and Windows (as well as different versions of each) do hinting differently, so we're unlikely to get a pixel-perfect match. However, a bit of experimentation shows that Liberation Sans Bold at 16px, with hinting disabled, gives a pretty good match, so I'll go with that:

To get the drop shadow, I first created a text layer with the text in white, setting text alignment to centered and extending the layer horizontally to each side of the image, and adjusting the vertical position to get the baseline to match. It helps to have a copy of the original image opened as a layer for this. This is also the point where you should tweak the text size, font and hinting settings to approximately match the original:
Image with recreated text, no shadow

Next, I duplicated the text layer, changed the text color in the lower layer to black, and moved the layer one pixel to the right. This matched the original shadow in position, but made it look too dark, so I lowered the opacity of the lower layer until it looked good. 25% opacity seems to match the original pretty well:
Image with recreated text and 25% shadow

Now, all that remains is to change the text to read "PC", or whatever else you want. Remember to do it to both of the text layers (but that'll be kind of obvious). Save the resulting image in XCF format for later editing, and a copy in PNG or GIF format for the web:
Image with new text

And there you go!

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.