Icon

Bring Out The GIMP

Running the venerable open-source image editor on Mac OS X

Even if you've never been in the same ZIP code as a UNIX-based PC, you may have heard some of the buzz surrounding the GIMP. If you haven't, here's the scoop in a very small nutshell: the GIMP (which stands for GNU Image Manipulation Program, by the way) is a free image editor. While early versions of the GIMP left much to be desired, not the least of which was the fact that it ran solely on various flavors of UNIX, the GIMP has matured into—dare I say—a viable alternative to Photoshop. Even better, the GIMP has been ported to other operating systems, Mac OS X included. Even more betterer, did I mention that it's free? So in these times of economic strife, when it may be hard to scrape up even an extra $99 to get yourself a copy of Photoshop Elements, taking the time and the bit of elbow grease necessary to get the GIMP up and functioning on OS X may be well worth the effort.

Before I get too far into things, let me preface this tutorial by saying that I'm not actually going to provide any knowledge about how to use the GIMP. The GIMP is actually pretty easy to get up to speed with, especially if you're already familiar with Photoshop, and there's some excellent documentation available at the GIMP.org web site to help you along. So without any further ado...

Now, if you're a Windows user, what are you doing here? Didn't the title of this article turn you away? Just kidding. Initially, you're actually in better shape to run the GIMP than Mac OS X users, because it's been packaged up into a tidy little Win32 installer, requiring no extra work. Head on over to the WinGIMP web site, where you can grab everything you need in a single download. Point, click, and you're up and running. So Windows users, you're done. Have fun using the GIMP.

Things aren't so straightforward for Mac OS X users, unfortunately. Getting the GIMP running on OS X requires us to dive headfirst into the shallow end of the UNIX pool, but relax. Believe me, if I can do this, so can you. Some of the friendly folks in the open-source community have been working tirelessly to make downloading, compiling, and installing UNIX applications into Mac OS X's UNIX environment relatively painless, and we're going to be taking advantage of the fruits of their labors to make the experience as Mac-like as possible. While we are going to be getting our hands dirty in the Terminal, the upshot of all this is that by the time we're done not only will you be running the GIMP, you'll also have all the tools in place to begin to branch out and start messing with all kinds of open-source UNIX packages, from MS Word-compatible word processors to text-only browsers to Gnutella clients, etc. Ready? Good.

Step 1—Install OS X's Developer Tools

What we're going to be doing requires that you have the various software development apps Apple has made available in its optional Developer Tools package. If you don't have these tools installed already, they should be on one of the CDs that came with your version of OS X. If you don't have this CD, or if you prefer to have the latest (December 2002, as of this writing) version, head over to the Apple Developer Connection, where you can register (for free) and download the installer for the Developer Tools. Once you've got the installer, just launch the install package, pick the Easy Install option, and when everything finishes up you'll be ready to roll.

Step 2—Enable Superuser

If you and the Terminal have never been acquainted, chances are probably near 100% that you have not enabled root access to your machine. You'll need to do this or nothing we're going to do henceforth will work. There are a few ways to do this, but I'm going to show you the one I find most straightforward. Fire up the Terminal (located inside the Utilities folder in your Applications directory), and at the command prompt enter the following:

sudo passwd root <return>

In case you were wondering what's going on here, "sudo" means "perform what I'm about to tell you as the superuser," "passwd" is a command that creates passwords, "root" is the account you're creating the password for, and means to press the return key to enter the command. I'll be using this convention for other Terminal commands we're going to input later, incidentally. Anyway, you'll first be read the riot act about how enabling root access can really mess up your machine. Please, heed that warning! While we're going to use the awesome power of root access responsibly in the following steps, you really can foul things up if you go using it all willy-nilly and stuff. Anyway, lecture over. After the warning, you'll then need to enter a password for the root account, confirm it, and then you'll be ready to move on. You can go ahead and quit the Terminal for now.

Step 3—XWindows on OS X

In order to run certain UNIX-based apps (like the GIMP) on OS X, you have to install a virtual UNIX environment on top of OS X. A little background: on UNIX machines, you'll generally get nothing but a command line interface unless you throw a GUI on top of it (like the KDE or GNOME windowing systems that give Linux distros their Windows-like appearance). Mac OS X is a little different, in that the Aqua interface isn't a "real" UNIX windowing system, and true UNIX apps can't just run natively in Aqua without being specifically programmed to do so. Therefore, you'll have to install something called XWindows, which will interface with the underlying Apple Darwin variant of UNIX. For that task, we'll turn to the XFree86 project.

XFree86 is an open-source effort that brings an XWindows implementation to many UNIX variants, OS X included. To install XFree86, head over to the XonX home page to grab the installers. At the very least, you'll need the version 4.2.0 installer, and if you're running Jaguar, you'll also need to get the 4.2.0.1 update to be compatible with OS X 10.2. What the hey, might as well snag the 4.2.1.1 patch while you're at it, and you'll really be up to date. Install 4.2.0 first, and then the two updates. These are native OS X installers, so just follow the instructions you get during the installation processes and you should have no problem. Just so everything is working as it should after the installation, go ahead and launch the XDarwin program that should now be sitting in your Applications directory (provided that's where you put it when asked during the installation of XFree86). You'll be presented with a dialog box (fig. 1), asking you if you want XDarwin to take over your screen or be "rootless"," meaning you can see Aqua running underneath XWindows. I prefer rootless, but it doesn't really matter. If you've done everything correctly to this point, you'll get a screen that might look decidedly non-Mac-like (fig. 2). This is the XWindows environment, so despite how things might look now, you're on the right track.


Figure 1: XFree86's opening dialog box.


Figure 2: The very UNIX-y XDarwin interface running on OS X.

Step 4—Aquify XFree86

Now, if things aren't complex enough for you yet, we're going to add yet another piece of software here that makes XFree86 much more Mac-like. This step isn't necessary, so if you don't mind having the strange UNIX-y looking environment running on top of Aqua you saw under XDarwin, just skip this step and use the XDarwin application in later steps instead of the OroborOSX program we're going to get right now.

OK, for those of you who didn't skip ahead, let's meet OroborOSX. Funny name; cool program. What OroborOSX does is serve as the application you launch XWindows with instead of XDarwin. Why? Because OroborOSX adds some Aqua-like features to XWindows, and even lets you interleave native Aqua windows with UNIX applications running under XWindows (fig. 3). Even pressing the minimize widget on the menubar of a UNIX window "shoops" it down to the Dock, just like any other Aqua window (fig. 4). Plus, OroborOSX adds drag-and-drop functionality to XWindows, making it possible to open native UNIX files in their corresponding applications just by dropping them onto the OroborOSX Dock icon. Even better, you can create little UNIX program applets that can live in the OS X environment and can launch UNIX programs right from Aqua like any native OS X program. Basically, all this is a roundabout way of saying that OroborOSX integrates XWindows into the native OS X environment really well, and XWindows on OS X a lot more seamless to work with alongside everything else you're doing natively. Anyway, head on over to the OroborOSX site and get the latest version. This installation is nothing more than unpacking an archive, so you're safe dragging the OroborOSX folder wherever you want it to go on your system. Once OroborOSX is where you like it, go ahead and launch it to check and see if everything is working OK. If you checked out if XDarwin was working in the last step, you'll notice the difference right away (fig. 5). Go ahead and quit OroborOSX for now, and we'll be ready for Fink.


Figure 3: Here's the Aqua interleaving ability OroborOSX gives you: in this example, we have a UNIX terminal sitting on top of a Finder window sitting on top of a UNIX copy utility.


Figure 4: We've caught the UNIX terminal right in the act of minimizing to the Dock, just like any other Aqua window.


Figure 5: Before and after: XDarwin's terminal at the top, and the same program under OroborOSX on the bottom.

Step 5—Think Fink

Normally, installing UNIX programs can be a real drag. You have to download source code for the program you want, make sure you have any other software package that the program you want relies on to work, compile the source, yadda yadda yadda. Fortunately, Fink ends all of that for Mac users. Fink is a program that runs in the terminal that makes it really, really easy to download and install UNIX programs. Many of the most popular UNIX programs, the GIMP included, have been precompiled into Mac-compatible binaries, ready and waiting for Fink to come and get 'em. Even if the binaries for a particular program haven't been compiled for OS X, Fink lets you at the source code and goes through the process of compiling and installing the packages for you. Long story longer, Fink reduces the process of installing UNIX apps (plus any dependencies) on OS X to just couple of commands in the Terminal. So head over to the Fink site and download the latest version. You know the drill: it's a native installer, so I'll see you back here after you're done installing it.

Ah, but there's a snag here. Fink won't work unless you manually add a line to the config file of your shell. I'm not sure why this part isn't handled during the Fink installation, but we're going to need to do this ourselves. Open up the Terminal, and enter the following command:

pico .cshrc <return>

"Pico" is a command-line text editor, ".cshrc" is the configuration file we're going to mess with, and then press to enter the command. For me, the .cshrc file didn't have anything in it; your mileage may vary here. Add the following:

source /sw/bin/init.csh

I'd explain what this does except for the small fact that I don't really know. I assume it's telling the Terminal how to access something in the sw directory Fink added to your hard drive during the install so that Fink can work correctly, but I could be wrong. Anyway, once that text has been entered, press ctrl-o (the Pico equivalent of Save), press Return, and then press ctrl-x (Pico's Exit command). Quit the Terminal, and then launch it again so your changes can be read by the shell.

Step 6—Using Fink

So now that you've got the Terminal open again, type:

su <return>

to log in as root. Enter your password, and then type:

fink <return>

You should see a list of commands (fig. 6) that tell you how to use Fink to get UNIX packages. We're going to do a bit of housecleaning here to make getting the GIMP easier. Type the following into the terminal:

fink selfupdate <return>


Figure 6: The authors of Fink have done a great job of distilling the process of installing UNIX apps on OS X down to a very manageable list of commands.

Just use the defaults when asked, but make sure you use your own login name instead of root when it asks you. This command updates Fink to the latest software available. Once that process is done, type:

apt-get update <return>

Since "apt-get" is the command Fink uses to get precompiled binaries, this particluar command updates the list of files you can get using apt-get. The default installation of Fink doesn't include the GIMP on its list of precompiled binaries, meaning you would have to type fink install gimp to install the GIMP, which would ultimately lead to having to compile the GIMP from the source code. Compiling source code can take a very, very long time to do, so whenever possible it's much quicker to get whatever you can using apt-get, as all of the heavy lifting has already been done for you.

Step 7—Getting the GIMP

Oh, we're getting so close! I can almost smell it. Enter the following command in the Terminal:

apt-get install gimp <return>

Just say yes when asked about NetInfo stuff, and boom. Some cryptic Terminal text will fly by, and once you see the command prompt again, the GIMP is installed and ready to use. Ahh, but how do you launch the GIMP?

Step 8—Launching the GIMP

Here we are: the moment of truth. To run the GIMP, first launch OroborOSX (or XDarwin, if you skipped ahead way back when). In OroborOSX, just go to the Launch menu and select MacGIMP (fig. 7). Or, if you're either in XDarwin or prefer to use the XTerm program that opens automatically from OroborOSX, just enter "gimp" at the command prompt. That's it! You should be presented with a couple of configuration screens. You can just accept the defaults, and by golly, you're running the GIMP on Mac OS X (fig. 8).


Figure 7: Now that the GIMP is installed, you can use the MacGimp menu item that's already in the OroborOSX Launch menu to start up the GIMP.


Figure 8: Here it is! The GIMP lives on OS X. It even looks like an Aqua program, more or less.

Wrapping it up

While getting the GIMP (or any other UNIX app, for that matter) to run on Mac OS X isn't the most straightforward task in the world, hopefully we've killed two birds with one stone here. First, you've got a pretty nice UNIX environment installed and an easy way to get more UNIX programs, and second, you've got a very capable free image editor ready and waiting for you to explore. Happy GIMPing!

^ Top of Page

Got Feedback? to send an email. I'll do my best to answer. Really.