I have two layers. Layer one has the background image (some landscape) and layer two is colored. Layer two is above and I insert a text on top of layer two and merge it with layer two and then set text to transparent so I see the background layer.

The problem is the character edges are not sharp. Is there a way to get sharp edges for the text?

4 Answers
4

It's somewhat unclear what you mean by the text being "not sharp", so I'll give a variety of possible suggestions below. But first, just to set a baseline, here's some ordinary text in the GIMP (16px Sans, antialiased, no hinting, scaled up 2x):

This already looks pretty sharp to me, but here are a few things you could do to make it even sharper:

1. Enable hinting:

Hinting is a method of adjusting the shapes of characters so that their edges better align with pixel boundaries. You can enable hinting in GIMP by clicking the text layer, selecting the text tool and checking the "Hinting" checkbox in the tool options. (It's enabled by default, but you might have disabled it.)

There's also another checkbox, "Force auto-hinter", which controls the actual hinting method GIMP will use: with the box unchecked, GIMP will follow any custom hinting instructions embedded in the font, whereas checking the box makes GIMP use only its own generic font-independent hinting algorithm. Either hinting method should make the text look sharper, but the results of the two methods can be quite different, as shown below (normal hinting on left, auto-hinter on right):

In this particular case, the auto-hinter doesn't change the appearance much, although if you compare it side-to-side with the unhinted version, you can see some sharpening. The custom-hinted version, however, looks very different, with most line widths adjusted to be exactly one pixel wide.

Note that, with hinting enabled, changing the font size by even a small amount can have a major effect on the appearance of the text. This is particularly true for fonts with aggressive hinting at at small sizes — with the auto-hinter, the changes are usually less pronounced.

2. Disable anti-aliasing:

The text tool options dialog also has a checkbox for disabling anti-aliasing entirely, so that every pixel of the text is either fully opaque or fully transparent. In some sense, this yields maximum sharpness, but usually at the cost of smoothness. If you do decide to turn off anti-aliasing, I'd strongly recommend enabling hinting, as you can see below (normal hinting on left, auto-hinter in middle, no hinting on right):

3. Add an outline:

Another possibility is that the "lack of sharpness" you describe is caused by the text blending in with the background, particularly if the background is "busy" or similar in color to the text, like in this example:

In that case, playing with hinting or anti-aliasing settings won't help, since the problem is lack of contrast between the text and the background. Instead, what you can do is surround the text with a high-contrast outline to separate it from the background. Here's one way to do it:

Select the text layer, choose the text tool and click the "Path from Text" button at the bottom of the tool options dialog.

Create a new transparent layer below the text layer and select it. (You can also draw the outline directly into the background layer, but using a separate layer is usually more convenient.)

Select a foreground color that contrasts well with the text (e.g. white if the text is dark, black if the text is light).

In the Paths dialog, select the previously created path and click the "Paint along the path" icon at the bottom. Make sure the "Stroke line" and "Solid color" options are selected and set the line width to a suitable value depending on the text size. (For example, I used 3 px below; remember that half of the outline width will be hidden behind the text.) The result should look something like this:

That's much more readable, isn't it? You can also tweak the outline in various ways, e.g. by blurring it:

or adjusting its opacity or, especially for a dark outline, moving the layer slightly to make it look like a drop shadow.

You possibly need to work in a higher resolution. If you set up your file to print/view at, say, 72 dpi (standard Internet image resolution), your text is going to be fuzzy for print work. Try working at a much higher resolution. This means your font size will be bigger and you'll view your work at less than 100%, but you'll have crisper edges to your text. You can zoom in to check more closely and you'll see that those pixel squares are much smaller. Also click off 'antialiased' in the text editor, and play around with the 'hinting'.

Now, if your work is intended for the Internet, it's still better to start at the higher resolution and resize the work once finished.

The problem is that text size is very little; when this happens, each pixel is great compared to text size; therefore, edges are going to be irregular (hint and aliasing do not help much).
If you change text size (for example 216px), each pixel will be small compared to text size and edges will be sharp. The more text size the less irregular edges.
After that you have to resize the text as image to match your design.

Like this!
I to have used Gimp to find the answer, and I am a Adobe Photoshop user, and still trying to fix Gimp to suit my needs.
I have used unsharp mask from Filter to Enhanced to Unsharp mask. To me this would of been Sharpen Image.

I know in photoshop I could use a record method for increasing the image pixel by pixel using a Bicubic if memory servers me correct. Sad thing is it has been awhile since I have used Adobe Photoshop.
There is a fine line between Adobe and Gimp.

I just hope this helps the others to see clear if this is the problem.

Showing the result is of little value if we can't tell what you started from. And the question isn't really about sharpening text that is present in a photo, but how to keep sharp text that is added in a photo.
– xenoidJun 30 at 22:16