LXF66.tut gimp.pdf

From LXF Wiki

GIMP TEXT TOOLS: Warping text

Twist and scale, shear and pinch. To the Gimp, text is just another bunch of pixels to play with. Michael J Hammel shows you how to warp letters while keeping them crisp.

Most graphic design projects require at least a little bit of text. In most cases the words need only be positioned, coloured and rendered using an appropriate typeface—they might sometimes be scaled, but other than that we don’t normally need to do anything too flash with them.

But sometimes the text needs to be warped to stand out. In the film poster on the right, for example, the title needed to be fluid and fluctuating in size, so it was laid out at an angle—large on the left and scaled down to the right—to simulate the letters being close to the reader on the left side of the poster and further away on the right.

To help you achieve this kind of effect, Gimp provides Scale, Perspective, Rotate and Shear transform tools, all available from the Gimp toolbox. When active, each tool opens a dialog box where you can specify precise settings for the tool’s action. Better yet, each tool works interactively—just click and drag the grab boxes in the image window, then hit the Enter key to apply the transformation on the current layer or selection.

While these tools are powerful in their own right, they only work as linear transforms. Imagine a straight line running through the text along the bottom of each letter. That imaginary line would stay straight no matter which of these tools was applied. In order to get the effect of curving text we need the assistance of some stock Gimp filters: Curve Bend and IWarp.

In this month’s tutorial we’ll explore two methods of warping text. The first tutorial will walk you through the stock transforms and then introduce the Curve Bend filter. The second tutorial repeats the process using IWarp instead of Curve Bend.

A note of warning about warping text in an image: text rendered on a layer and warped in this way is likely to lose some of its crisp edges. Some text, especially any that is enlarged as a result of the transform, can become slightly blurred or—the horror!—develop ‘stair stepping’. Stair stepping is exactly what it sounds like: a set of steps along a slightly angled edge. This ugly effect can be dealt with using some simple techniques, which I’ll discuss in the tutorials.

As a general rule you should try to avoid applying any kind of transformation on rendered text. That includes scaling, shearing and rotating. When possible, use a vector tool such as Inkscape to generate warped text. Then export the text from that program to a raster file format such as PNG, and use Gimp to import it.

This process requires multiple tools, but it does allow for more control over the final quality of the rendered text. It’s even possible to export the vector paths from those tools and import them into Gimp—though editing text-vector paths in the current Gimp version is not for the faint-hearted or designers with little time on their hands...


Tutorial 1: the Curve Bend filter

You can warp rendered text quickly with the transform tools and the Curve Bend filter. This is a fast, easy and interactive method, though it lacks a precise way to position where the text will be curved. It also suffers from the distortion problems common with modifying rendered text, making it unsuitable for a final print project, but it can be useful for online projects or prototyping layouts.

[Insert Tutorial with pictures. Captions are found at the end.]

We’ve just created curved text. The problem with this method is that we couldn’t specify precisely where on the text the curve should occur. It also isn’t obvious that when the upper curve is not copied to the lower curve, distortions occur that don’t seem to follow the curve just created.

I should note that the current version of the Curve Bend filter doesn’t handle alpha channels very well. Better results may be possible if the white background is duplicated and merged with the text layer before applying the Curve Bend filter. If you don’t do this there is a risk of truly bad stair stepping after the filter is applied.

One last gripe is that the text now appears slightly blurred. Scarling it down will help a little, but the next tutorial will show a more satisfactory method of cleaning the letter edges.

Tutorial 2: the IWarp filter

Curve Bend does an excellent job of warping the text, but it doesn’t feel precise. What would be better is something more directly interactive, something to just point, click, drag and distort. Something like IWarp.


[Insert Tutorial with Pictures. Captions are at the end]

The Unsharp mask we used in the second tutorial cleans the text by finding an edge in the pixels (defined as a sharp difference in colour between two areas of pixels) and reducing the contrast between them These two variables are controlled by the Radius setting and the Amount setting respectively.

When you work with very large text layers (necessary for large posters and other print projects), more dragging through the IWarp preview may be necessary than with the smaller text layers. The same effect can be achieved by moving smaller areas many times, each a little at a time.

That’s the really cool thing about IWarp: the level of control it gives to the user. If you don’t get it perfectly the first time (and don’t be frustrated if you don’t) you can fiddle with it until you get things just as you want them.

[Image captions below]

In this sample film poster, the main lettering has been warped with Gimp’s transform tools. They’re useful if you design flyers, posters or similar textual work.

Though text is best played with in vector programs, there are tools you can use in raster apps like Gimp. You’ll need these transform tools and grab boxes.

Fist tutorial pictures:

1/ Open a new image window at 420x300 pixels. Click on the Text tool to activate it, then click in the image window to open the text editor. Type in the letters TIMEWARP, all in upper case. In the Text Tool Options dialog (which is normally in the dock under the Toolbox), set the font to Sans Bold, size 70, and set the Justify option to Centred. Use the Move tool to centre the text layer over the background layer.

2/ Click on the Perspective transform tool. This tool, like all the transform tools, can be used interactively. Now click on the text layer again. Use the grab boxes to reduce the height of the right side of the lettering by dragging the bottom-right corner up a short distance and the top-right box down by the same distance (this will keep the text centred horizontally). Hit Enter when this is done.

The Layers dialog should have changed to show an ordinary layer instead of a text layer: the text can still be edited, but the shearing will be removed. If the Shear preview gets garbled with the original layer, turn the layer visibility off in the Layers dialog. Turn the layer visibility back on after the shear is applied.

3/ At this point the text doesn’t show much distortion—though it might look a bit less crisp than it did before we started monkeying with it. Now click on the Shear transform tool. In the image window, drag the bottom-right grab box up a short distance. Then press Enter, or click on the Shear button in the Shear dialog.

4/ After this, the left side of the text may appear more distorted than the right. You can clean this up a little by using the Unsharp Mask filter (Filters > Enhance > Unsharp Mask). For this small image set the Radius to 1.3 and the Amount to 0.35, leaving the Threshold at 0.

5/ To bend the text we’re going to use the Curve Bend filter (Filters > Distorts > Curve Bend). Click on the Upper toggle under the Curve For Border heading and drag the line to something similar to what’s shown here. Click on the Copy button. This copies the upper curve to the lower curve, which has the effect of keeping the text size fairly consistent with the original. Click on OK when this is done.


Second tutorial pictures:

1/ Repeat the text creation from the first tutorial up to but not including the application of Curve Bend. Open the IWarp filter (Filters > Distorts > IWarp). This filter is interactive – dragging the mouse through the preview will distort the image based on the settings chosen.

2/ Set the Deform mode to Move – a deform radius of roughly 55% and deform amount of 0.55 should be sufficient. Start in the bottom-right corner and start to drag up through the space between the letters E and W of TIMEWARP. Multiple drags may be necessary to achieve a respectable result.

Messed up? Hit the Reset button and try again. Experimentation is easy with this very user-friendly filter. When the distortion preview looks good, hit Enter or click on the OK button.

3/ Applying Curve Bend or IWarp will blur the text slightly. To make the lines around the text clean, create a selection around it with Layer > Transparency > Alpha To Selection if the text is on a transparent layer. Then invert the selection to get the background. If the text is merged with a white background, try using the Colour Select tool, clicking on the white region of the layer (inverting is not necessary in this case).

4/ Use Ctrl+X to delete the selected region – the transparent background will be deleted, along with most of the blurred areas. You can change the degree of cleaning by altering the selection tool’s feathering before you delete. Once the selection has been deleted, further cleaning can be done using Unsharp Mask (Filters > Enhance > Unsharp Mask). Set the Radius to 1.3 and the Amount to 0.35, leaving the Threshold at 0.