-->

Previous | Table of Contents | Next

Page 249

TIME SAVER
Not all graphics conversion programs included with your Linux distribution read the standard input and write to the standard output. Read the manual pages for any desired conversion programs before experimenting with pipes on the command line. Also, be cautious: preview or print the results of your conversions before discarding original files to make sure you achieve the effect you want, and that the resulting graphic does not suffer loss of image quality.

If you don't want to experiment with complex pipes, you may want to try using the convert command, one of seven programs in the ImageMagick package (discussed later in the section, "Graphics Editing with ImageMagick"). Using the convert command is an alternative way to translate files. Found under the /usr/bin directory, this command translates more than 75 different graphics file formats (even some not listed in Table 16.1). The convert program works by recognizing different file extensions on the command line, as shown in the following example.


# xwd >graphic.xwd

# convert graphic.xwd graphic.tiff

Again the xwd client is used to create an X11 window dump graphic. Then the convert command is made to create a .tiff file by specifying the .tiff extension on the second, or output file on the command line. For details about using the convert command, see the ImageMagick and convert command manual pages.

Graphic Editing with GIMP

Although you can change or manipulate graphics from the command line, if you use X11, it can be a lot more fun to interactively work with files using an image processing program. One of the best and newest graphics tools for Linux is GIMP, the GNU Image Manipulation Program by Spencer Kimball and Peter Mattis (see Figure 16.1).

This is a capable and complex program with many features. If you've worked with image-editing programs on other operating systems, you'll appreciate the tools and filters included with this program. The GIMP features

Page 250

Figure 16.1
The GIMP image
editor is an impressive
X11 client with many
professional features,
including nearly 100
different filters for
manipulating graphics.

You'll need nearly 23 megabytes of hard drive space to install GIMP, its software libraries, support files, and related directories. The main GIMP files are installed under the /usr/share/gimp/X.XX directory, where X.XX is the current version. A library of GIMP plug-ins is located under the /usr/lib/gimp/X.XX/plug-ins directory, where X.XX is the current version. Plug-ins are compiled modules, or programs run by GIMP from different menus.

This program has 11 different command-line options, but does not support X11 Toolkit options such as geometry settings. You can specify a graphic file on the command line. GIMP attempts to load and interpret the file according to the file's extension. Starting GIMP is easy; simply type the following.


# gimp &

When you first start GIMP, you'll be presented with a large window that provides details about various GIMP resource files. You'll be asked to confirm installation of a directory called .gimp in your home directory. This directory contains seven different files and subdirectories that specify how GIMP works, and lists your preferences for tools, brushes, and plug-ins.

Page 251

The file gimprc under your .gimp directory contains settings, such as default brushes, patterns, palettes, and temporary directories you can customize. You also can specify the type of measurement to be used in your rulers, such as pixels, inches, or centimeters, and whether or not GIMP performs auto-saving of your image files as you work.

CAUTION
The version of GIMP installed on your system lacks documentation, but you should know that if you edit large image files, you may quickly run out of disk space because GIMP creates large temporary files during editing sessions (this is not unusual, as even commercial image editing applications typically require swap storage three times larger than system memory). If you have a separate hard drive with a lot of room, change the swap-path (not the same as your Linux swap partition!) setting in the gimprc file to point to a directory on that drive. If you're really tight on memory and hard drive space, you can uncomment the stingy-memory-use option. On the other hand, if you have a lot of system memory, change the tile-cache size to force GIMP to use less swap space (and run faster).

Once GIMP is running, you can tear off different dialog boxes and windows by using the dialog menu item under the GIMP File menu. If you have an active image window, access the complete GIMP menu system by pressing your right mouse button while the cursor is over your image. The various menus will cascade, and you can select the file, edit, or other menu operations by dragging your cursor through the menus.

GIMP does not come with a manual page, but you'll find some documentation under the /usr/doc/gimp directory. For the latest news and details about this program, browse to the following site:




http://www.gimp.org

You'll find copies of the latest GIMP and links to GIMP Frequently Asked Questions lists, a GIMP tutorial, and new plug-ins.

Graphics Editing with ImageMagick

The ImageMagick package, by John Cristy, is a collection of seven programs you'll find installed on your system. Some of these commands require the X Window System, while others may be used from the command line. The convert command has already been discussed in this hour, but you may find some of the other utilities useful when you want to manipulate graphics:

Previous | Table of Contents | Next