Sunday, August 1, 2004

The GIMP, a free alternative to Photoshop

BUDGET PHOTO SECRETS

By Michael Oliveri

No worries, when we talk about the GIMP, we're not talking about Pulp Fiction or bondage. This is a family magazine.

In this case, the GIMP (or GNU Image Manipulation Program), a free (as in speech and beer) substitute for popular commercial image editors such as Adobe Photoshop and Corel PhotoPaint. For the majority of users, the GIMP will be able to accomplish all of their image-editing tasks and more. For the rest, the community-driven nature of the GIMP ensures that requested features will likely be available soon.

In this article, my plan is to provide you with a brief introduction to the GIMP from installation through a few basic tasks. Complete information on the GIMP can be found at the project's home page, http://www.gimp.org. A plethora of documentation is also available, and, in the true Open Source spirit, the book Grokking the GIMP is available for free at http://gimp-savvy.com/BOOK.

Downloading and installing the GIMP

As of this writing, version 1.2.5 is the current stable release. Version 2.0 is in the pre-release stage for developers and power users and is at 2.0pre4. For those of you using Macs and Windows, I'm about to say some scary things about compiling source code. Don't worry; I'm only talking to Linux users. There's a point-and-click installer available if you don't want to get under the hood.

If you're running Linux, chances are you already have the GIMP installed as it comes with most major distributions. If not, source code can be downloaded from the Web site above by selecting Download from the menu bar and following links to the desired version.Installation is just a matter of compiling and installing in the standard three-step process: ./configure, make, make install.

Linux users desiring pre-compiled binaries for easy installation should have little to no trouble finding the GIMP in their distribution's package format. Start with your distribution's CD's, otherwise rpmfind.net or apt-get should be able to set you up.

Running a Mac? With its BSD roots, OS X is about as close to Unix as you can get without slapping the label on the side. Check out http://www.macgimp.org for all your photo editing needs. I don't have a Mac available, so the specifics of the GIMP on OS X are unfortunately beyond the scope of this article.

While the GIMP is primarily written and developed for Linux and other Unix systems, Windows users should not feel left out, as shown in Figure A.

FIGURE A

Here's the GIMP running on Windows XP. (click for larger image)

The GIMP for Windows is maintained separately and can be found at http://www.gimp.org/~tml/gimp/win32/. Because the GIMP makes extensive use of GTK+ or the GIMP Tool Kit, Windows users should download both the GIMP binaries and the GTK+ package. They are provided in .zip format and, once downloaded and unzipped, you will find the install program for each. Install GTK+ first, then the GIMP. The defaults should be fine for most users, such as install directories, languages, and components.

The wacky world of GIF, patent licensing, and creative workarounds

Note on the GIF format: due to patent issues in the United States with the LZW (Lempel-Ziv-Welch) compression algorithm, GIF format is not included in the installer for Windows (why this does not apply to the Linux version is admittedly beyond my understanding).

Without the missing GIF format file, you will be able to open and view GIF images but not be able to save them. Links are provided to download the file for non-US users, otherwise you will need a license from Unisys. Of course, if you're the type who's fond of using peer-to-peer services, you've probably already downloaded and unzipped the file. Regardless, once downloaded it's just a matter of unzipping the file and placing the enclosed .exe file in the Plugins folder under your GIMP root directory.

Again, because of patent and DMCA (Digital Millennium Copyright Act) issues, please don't come to me or the Connected Photographer editors for the GIF file. Just spend a little time in Google. After all, what's a little creative search-engine work when you're saving hundreds of dollars using a free program?

Starting the GIMP for the first time

Regardless of platform, when you first fire up the GIMP it will take you through the process of setting it up for your individual needs. Primarily, this involves designating folders for your images and custom tools, memory performance tuning, and customizing monitor resolution. Based on your system setup, the GIMP will suggest defaults for all, and they probably won't need to be adjusted except for special situations.

A GIMP Tip of the Day will welcome you to the GIMP itself, and you will have the option of disabling these in the future. I suggest you leave them on, at least for a while, as new users will pick up some cool information and Photoshop users may find subtle differences (i.e., keystrokes or tool usage) between Photoshop and the GIMP.

Referring back to Figure A, the first thing Windows users will notice is that the GIMP tool boxes are not confined to a one larger window; instead, each is its own, free-floating window complete with its own tab in the toolbar. In Windows XP, these will be grouped under one tab labeled the GIMP in case of clutter, just as Internet Explorer does when you have several windows open.

Photoshop users should find the main toolbar familiar, as shown in Figure B.

FIGURE B

The GIMP toolbar. Oooohhhh. Aaaaaahhhh. (click for larger image)

All of your basic tools are there, from brushes and rulers to selection tools and color controls. The brush selection is very extensive, as shown in Figure C, including pre-defined styles with different textures and gradients.

FIGURE C

Brush up on your brushes. (click for larger image)

Brush spacing is adjustable with a simple slider. If you're into creating your own brushes for design work, this feature is supported as well. Finally, no real image editor would be complete without a Layers dialog, as shown in Figure D.

FIGURE D

Use this software or we'll retouch this doggy. (click for larger image)

Most work can be accomplished through the menus. If you've opened the File menu, you'll find it surprisingly bare. To save time, the creators of the GIMP have made most features and functions available by simply right-clicking the image. If you'll refer back to Figure A, you'll see this in action. Typical photo editing tasks such as cropping and resizing are all available here, as well as a number of fancier tools. Saving, exporting, and the always-helpful Undo feature are all in this menu as well.

A few simple tasks

Now that we've installed the GIMP and explored a little bit, let's try a few basic functions: zooming, saving, cropping, and resizing. First you're going to need an image to edit. Simply select Open from the File menu and you will be presented with the ubiquitous file browsing dialog. In this example, I've browsed to my pictures folder and have selected a picture of a nasty-looking spider that I'd like to display on the web. It's 1600x1200, much larger than I'd prefer to upload. At this size, the GIMP has opened it with a default zoom level of 50% to display the full image on-screen.

I want to work with the full-size image for this crop, so first let's blow it up. To zoom in, right-click your image, then select Zoom -> 1:1 from the View menu. This nets the view shown in Figure E on my 1280x1024 desktop.

FIGURE E

Even though this image may require some scrolling after you click the thumbnail, we've left it big so you can really see it in all its glory. (click for larger image)

Note here that keyboard shortcuts are displayed to the right of menu options. So, in this case, I could also have obtained the 1:1 zoom by touching 1 on the keyboard.

Now, we don't want to ruin our original photos, so let's save a copy to work with. Right-click your image and select Save As... from the File menu. Browse to a new folder if you like, and type the new file name below. Note as well you can change the file type here if desired either by typing it by hand with "By file type" selected or by selecting a specific file type from the drop-down menu. Upon saving, you will be presented with an additional dialog as appropriate to the format to tweak options such as compression or comments.

Next let's crop the image. Once again you right-click the image, then select Transform Tools -> Crop & Resize from the Tools menu (or Shift+C on the keyboard). Click the image once and the Crop & Resize Information dialog box will appear near the center of the screen as shown in Figure F, showing the XY coordinates of your starting point and the window size as you drag and create your crop or resizing area.

FIGURE F

First we talk about GIMP. Then about crops. Just keep you mind out of the gutter, OK? (click for larger image)

This is a feature I really like in the GIMP. Most other tools I've worked with require watching the toolbars for the given information. Simply move the crop box out of your way, then draw your cropping area by clicking and dragging. The Crop & Resize Information dialog box will display the size of crop rectangle as you drag. To refine your selection, you can drag the upper-left and lower-right corners to resize the selection and the upper-right and lower-left corners to move the selection.

With the spider, I'm going to get in nice and tight for the full booga-booga effect. I center and draw a 400x400-pixel box, click Crop in the dialog box, and voila, we've got our closeup, as shown in Figure G.

FIGURE G

Spidey-sense tells me this is a powerful program. (click for larger image)

At this size, this image is suitable for displaying solid detail. However, maybe we need a thumbnail for a link, or perhaps we'd like a nifty buddy icon to freak out our friends on Instant Messenger. In either case, I want to shrink it down to 50x50 pixels.

I could resize with the Crop & Resize tool, but there's an easier way many of you are probably already familiar with. Right-click yet again, and select Scale Image... from the Image menu. Here we have full control over our Pixel Dimensions and our Print Size & Display Units, as shown in Figure G.

FIGURE H

I'm shrinking... (click for larger image)

The units can be changed if so desired, but I'm going to stick with pixels. As with Photoshop, the chain keeps the ratio proportional (Corel PhotoPaint users will know this as the "Constrain Proportions" option). Simply type 50 in New Width, and the Height adjusts accordingly. Click OK to apply the change, do another Save As, and we now have two edited versions of the original image.

Piece of cake!

Conclusion

While hard-core enthusiasts or industry professionals may prefer to stick with tried-and-true products like Adobe Photoshop, the GIMP easily fulfills the role of a powerful image editor for the home user. And it's free, so you've certainly got nothing to lose by downloading it and giving it a whirl!

I also would not hesitate to recommend the GIMP for newbies. My own experience with the GIMP was certainly no more daunting than my first experience with PhotoShop, and because it's free, you won't have to worry about spending a fair chunk of change for a full version you may find too complicated, or spend less money and settle for a less full-featured package such as Photoshop Elements.

Michael Oliveri is a sysadmin for a small ISP, a writer, a Linux geek, and an amateur photographer. More information on his work can be found at http://www.mikeoliveri.com.