|
| Text With Sharp Borders |
|---|
|
After a few months on the gimp-user mailing list, I noticed that the same questions pop up from time to time. I thought that it might be nice to make a few tutorials as my gift back to the gimp community. Here was the next question that popped up and the resulting tutorial:
Hello, I've tried to create colored fonts with a sharp black border around it. But I can't get gimp to draw real sharp borders because it uses too much antialiasing and bilinear filtering (the border is ALWAYS more then 3 pixels wide). i've tried several methods, edit:stroke, selection:border etc ... Everything looks to smooth and blurred all the time :( I've attached small image of what I want to acomplish. Bye, chris This tutorial will cover the "edit:stroke" method of making text with a border. Note: The Gimp is a powerful program and there are often multiple ways of doing things. If you have a different technique of getting desired results and you would like to write a branch to this tutorial please contact me. |
| New Image |
First we need to make a new image. (size 256x100, type RGB)
Open the 'Layers&Channels' - dialog window by pressing the right mousebutton on the image and choose Dialogs
On the Layers&Channels-window, click the layer name ('Background') with the right mousebutton and choose 'New Layer' to add a new layer to your image. When prompted, name the layer 'Text'.
|
| Your Text String |
Make sure you have the New Layer selected on the layers-dialog, and choose the Text-tool and apply your text string. Tip: You can find over a thousand free fonts over at Type Euphoria. They also have instructions for installing them in Linux and Windows.
Try to place the text in the center of the image. Once the text is in the proper place, press Ctrl-H or select Layers |
| Add Some Color |
There is a tiny little button in the Layers&Channels window that says: 'Keep Trans'. This is the key to the next step we are going to take. Make sure it is pressed in. If the next step gets screwed up, you forgot it. Next we will fill the text with a gradient. First we need to select the colors - I chose gold as the foreground-color (upper-left square in the toolbox color selector) and orangeas the background color (lower-right square). Once you think the colors are OK, select the Blend tool (gradient fill tool). Make a nice gradient from top to bottom. IF your entire image changes to a gradient, you forgot something I told you. :-) |
| Prep work for the Outline |
On the Layers&Channels - window. click on the text layer with the right mousebutton and choose 'Alpha to Selection' to select the text. Now return to the Layers&Channels - window, and change to the 'Background' layer by clicking on it. Then click it again with the right mousebutton this time and choose 'New Layer' to add a third layer to the image. Name this layer 'Outline'.
Open the 'Brushes Selection' - dialog window by pressing the right mousebutton on the image and selecting Dialogs The outline is going to be controlled by the size and setting of the brush we use to make it. We want a two pixel wide border with hard edges. My copy of the Gimp did not come with a 2x2 round brush so I made one by clicking on the 'New' button in the 'Brush Selection' - dialog window. I changed the Radius to '2.0', and the Hardness to 1.0 and named it Circle (2).
Reset your foreground-color to black by clicking the mini black and white overlapping squares in the color selector.
|
| Make the Outline |
Everything is ready, it it time to make the outline.
Press the right moustbutton on the image and select Edit If you have done everything correctly your image should have a crisp two pixel border around the colored text. This is a good time to save your work as in the native Gimp format .xcf. Saving in the .xcf format will preserve the layers just in case you decide to invert the border or change the text color later on. |
| Prep for Publication |
If you are going to publish the image on the web, you might want to delete the background layer and save the image with transparency. On the Layers&Channels - dialog window, click the layer name ('Background') to select it. Then, with the right mousebutton and choose 'Delete Layer' to delete the background layer from your image. RightMouseClick on either of the two remaining layers and select 'Merge Visible Layers'. When prompted with the 'Layer Merge Options' - dialog choose 'Clipped to Image'.
Save it as a .gif and you are done. |
| Resources |
|
Grab a copy of outline.xcf by right mouse clicking on it and doing a 'Save Link As'. I also made a bizarre looking image by mistake when playing around with the dithering options in gif export.
I would like to say Thank You to Tigert for his tutorials. If you haven't seen them yet go there NOW and check'em out!
|