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.
Filters aka Plug-Ins

After all this, we've finally come to a place where we can talk about filters. Much of your image work will be based on filters, also referred to as Plug-Ins. These are external programs called by the GIMP to process part or all of the current layer of a given image window. Filters use the GIMP's Plug-In API (application programming interface) to access image data via shared memory. Although the filters are external programs, they cannot be used outside the GIMP.

Quite a number of filters are now delivered as part of the core GIMP package. They can be placed either in the system plug-in directories, usually /usr/local/lib/gimp/release/plug-ins or in the users .gimp/plug-ins directory. When the GIMP starts, it will query the plug-ins for necessary information so that the menu options can be built. Consequently, when you've added large numbers of plug-ins to these directories, the GIMP can take a bit of time to get started. Using the default set of filters, start-up time isn't too bad on a Pentium 133MHz system.

All of the filters are accessed through the Image Windows Filters menu option. Filters are broken into a number of categories ranging from Blurs to Distorts to Rendering options. Some filters work on the existing image directly, modifying the existing pixels based on the plug-ins function. For example, a blur looks at the pixels in an image and samples those that are near each other to produce a blurred effect. The pixels sampled can be either the whole image or a selected region. Other filters, such as IFSCompose, create new images in the current layer, so you may wish to either start with a completely new image or at least a new layer before running these filters. Experimentation is the key—play with the filters on stock images to see how they effect it and its layers.

Figure 9. Bump Map Plug-In

Figure 10. Bump Map Image

I've included samples of just two of the filters: IFS Compose and Bump Map. The latter is an interesting 3D effect that is easily added to 2D images. The IFS Compose is a fractal-based tool that can be used to create some rather stunning images. I've played with this tool quite a bit and am still amazed at the range of effects that are possible. One important thing to remember about IFS Compose—you can add and delete the control triangles. For the longest time I simply played with the default three triangles. Adding triangles allows even greater flexibility to the effects.

Figure 11. IFSCompose Plug-In

Figure 12. IFSCompose Image

Script FU

An extension to the filters is the builtin scripting language, Script FU. This is a Scheme-based scripting language that allows you to string sets of filters and other GIMP internal commands and tools together to create interesting effects. A set of predefined scripts is distributed with the core GIMP package. Many of these are used to create very interesting logos.

Scripts make use of an internal database of routines that have been registered for use by plug-ins and scripts. This database is called the Procedural Database or PDB. There is at least one script available for browsing the database. All the routines in the database are registered by plug-ins or the GIMP itself using a set of parameters that allow it to be self documenting. The PDB browser prints this information in a window showing the inputs and outputs for the routine, the author and a short descriptive blurb.

I'm not a big fan of Scheme, but that's mostly because I'm getting old, crotchety and tired of learning the language du jour. There is hope, however, for people like me. The GIMP's scripting language is just one example of a GIMP Extension. Extensions can be written by anyone, much like plug-ins, but the details are a bit beyond my understanding right now. I do know that at least one other scripting language extension has been written—for Tcl. Unfortunately, I don't know that language either. Ah, well.

Keyboard Accelerators and GTK

Finally, I think I should mention one of the lesser known but really nifty features of the GIMP. Actually, it's not really part of the GIMP, it's part of GTK, the windowing toolkit upon which the GIMP is based. Most windowing systems have keyboard accelerators, or keyboard shortcuts, that allow you access to window features directly from the keyboard. This is also true of GTK; however, GTK goes one step beyond. Other toolkits allow developers to predefine the accelerators in the source code or allow users to define them in configuration scripts used by the toolkits at start up time. GTK allows the user to set the accelerators at run time--you simply move the mouse over the menu item you wish to set, making sure the menu option is active (don't click the mouse on it, just move the cursor over it) and press the keystroke you wish to use for the keyboard accelerator. For example, moving the mouse over the “File->Print” option in the Image Windows menus, I press ctrl-P to set the keyboard accelerator for printing. Now, instead of having to go to the menu option, I just type ctrl-P over the image I wish to print.

Changes to the accelerators are saved between sessions, so you don't have to redo them each time you start the GIMP. You should be able to disable the accelerator by typing the same keystroke, but that didn't seem to work in the version I had. If a menu option already has an accelerator, just type the new key strokes to change it. This is a pretty nifty feature, as it puts more control in the hands of the user. As an X programmer by trade, I can say this is definitely a design goal of windowing application developers.

Resources on the Net

Michael J. Hammel (mjhammel@csn.net) a Computer Science graduate of Texas Tech University, is a software developer specializing in X/Motif living in Denver, Colorado. He writes the monthly Graphics Muse column in Linux Gazette, maintains the Linux Graphics mini-HOWTO, helps administer the Internet Ray Tracing Competition (http://irtc.org/) and coauthored The Unix Web Server Book, published by Ventana Press. His outside interests include running, basketball, Thai food, gardening and dogs.

______________________

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