The Quick Start Guide to the GIMP, Part Four

Our series winds up with a detailed description of the toolbox, plug-ins and keyboard acceleration.
Selections

One of the most important aspects of any tool like the GIMP is the ability to select regions of an image to be processed. Knowing the types of selections that are available and how to use them will greatly enhance your use of the GIMP.

The simplest selection is the one which selects the entire current layer. This particular selection can either be done via the Image Window menus or by using the ctrl-A keyboard accelerator. Once selected, the region is surrounded by the marching ants. Once a region is selected, it is important to know how to turn off the selection. One method is to click on one of the Selection Tools in the Toolbox and then click the left mouse button in a region of the image that is not currently selected. In the case where ctrl-A was used to select the entire layer, you need another way to turn off the selection since there is no section of the image that is not selected. Again, the Image Window menus and keyboard accelerators provide the answer. shift-ctrl-A turns off the selection. Note that this will turn off any selection, not just those created with ctrl-A.

The Toolbox offers the five basic selection methods: Rectangular, Elliptical, Free Hand, Fuzzy and Bezier. For those of you who have used Adobe Photoshop, the Rectangular and Elliptical selections are accessed from Photoshop using a single tool called the Marquee. The Free Hand selection tool in the GIMP is referred to as the Lasso in Photoshop. All of these work basically the same, although the Tool Options dialogs in the GIMP look different than their counterparts in Photoshop.

The Bezier selection tool in the GIMP is accessed via the Lasso tool in Photoshop using Paths. In the GIMP the user creates the paths for the selection using the tools in much the same manner as the Free Hand tool except that control points are used to refine the path of the selection. Fuzzy selections are based on the range of pixel values over which the user drags the mouse. A fuzzy selection can be used to select all regions with the same single color or all regions which encompass a range of values.

There are a few additional features common to all of the selection methods. First, all selections can be “feathered”. A feathered selection means that the edge of the selection turns into a fading pattern, from current image to transparent. The feathering starts at the edge of the selection and continues out for the specified number of pixels. Also, all Toolbox selections allow for antialiasing, which reduces the jagged appearance of the selection in some cases. Some selection tools provide a “Sample Merged” option in the Tool Options dialog. This option allows the selection to be taken based on the visible image and not just the currently active layer.

Clearing a selection (available from the Image Window menus as “Edit->Clear”) removes the selected region. The cleared area is transparent if the active layer contains an Alpha channel. If it doesn't, the cleared area takes on the background color. Filling a selection (“Edit->Fill” from the Image Windows menus) will fill a selection to the background color. Selections can be extended by holding down the shift key while performing another selection. They can be reduced or otherwise have sections removed by holding down the control (ctrl) key while performing another selection.

There are a number of other options available for selections, such as selecting regions by color, or extending and shrinking selections. All of these are available from the Selections submenu in the Image Window's pop-down menu. One of the newer features is the ability to snap selections to the Ruler Guides. The “View->Snap To Guides” menu option toggles the snap action on or off.

Selections can be moved, rotated, flipped, filled, cut, pasted and have any of the filters applied. The selection applies only to the active layer, but whatever process was applied to a single layer can be repeated by simply selecting a different layer, leaving the selection outline in place, and then choosing the “Edit->Redo” option from the Image Window menus. Selections, once moved in any manner, become floating layers in the Layers and Channels dialog. You must make sure this floating layer is given a final disposition—either making it a new layer or anchoring it the currently active layer—before continuing with your work.

Text

One of the most useful aspects of the GIMP is its ability to manipulate text. Logos, cover art and birthday cards are all possible given the many features provided by the GIMP. In order to add text to your images, you first need to understand how the GIMP gets access to text fonts.

The GIMP is based on Xlib and as such has access to the font rendering engines within the X server. This normally means that the GIMP has access to one of two types of fonts: Bitmap and Postscript Type 1 fonts. The former are not widely distributed (such as on commercial CDs from a software store like CompUSA or Egghead Software). My experience has been that you shouldn't bother with these types unless you happen to be given one. Conversely, Postscript Type 1, more commonly referred to simply as Type1, fonts are quite common. I've purchased at least four different CDs with literally thousands of Type1 fonts on them for use with Linux and X Window System applications. In order to make use of these fonts, you need to install them on your system and inform the X server. My Graphics Muse column in Linux Gazette (Issue 14, February 1997) had an article on how to do this titled “Adding Fonts To Your System”. Note that an additional format, TrueType, can also be used if you have a font server available for use. Caldera ships a font server with their packages, but most of the other distributions do not. Font servers have, in general, always been an additional package purchased separately for X servers on Linux systems.

Figure 8. Text Tool Dialog Window

Once you've gotten the fonts installed and available under X, you're ready to use them in the GIMP. The Text Tool in the Toolbox provides access to the fonts and is used to insert text into images. Figure 6 shows the Text Tool dialog window. When you click on the Text Tool button in the Toolbox and then click in the Image Window, the Text Tool dialog opens. If you have a large number of fonts installed on your system, the dialog will not open immediately the first time you access it—wait a moment or two as it gathers information about the available fonts. Subsequent invocations of the tool will not take so long, as the GIMP caches the information about fonts for better efficiency.

The Text Tool dialog provides a scrollable window that lists the available fonts by name, sorted alphabetically. Below this window is a window for typing the text you wish to add to the image. A limitation in the current implementation requires the text to be a single line (no carriage returns), so multiline text has to be created one line at a time. Fortunately, the addition of Guides (from the Image Window's Rulers) allows a fairly good way to line the text up.

The only other part of this dialog that you'll find yourself using regularly is the Size setting. The size value is a text field that you can type in to set the size of the font. Next to this is an options menu. This menu has two options: Pixels and Points. The difference isn't completely clear to me, so I use Pixels most of the time. I expect, when I become more educated as to the use of these settings, I'll find a need for the Points option. The Size value, however, is an item I use quite often. Note that when you type in a new size and press enter, the text field at the bottom of the dialog is adjusted to reflect the new size. Also note that the text in this field is not antialiased, even if the Antialiasing toggle button in the dialog is set (it's set when the toggle appears depressed). The antialiasing setting only affects the way the text is displayed in the image.

When you have finished setting up the font type, size and text, click on the OK button to apply the text to the image. As I stated earlier, the text is applied to a floating layer and can be moved around that floating layer. When the text is applied in this way, it is presented in the Image Window with the marching ants outline and a transparent (i.e., the underlying image is visible) body. When the cursor is placed over the transparent section (anywhere inside the marching ants) the text can be moved. For some fonts and sizes, it becomes very difficult to find the body of the text with the mouse pointer. In these cases, click on the Zoom Tool and then click by the text to zoom in on it. Once the text is more accessible to the pointer, you can select the Move Tool from the Toolbox and proceed to move the text around the image. When you have finished, be sure to create the new layer or anchor it to the current layer.

______________________

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix