prevnext


Obtaining And Installing Gimp

In this chapter, we will tell you how to obtain a copy of Gimp, and how to install it.

 

How To Install Gimp Personal Files

 

Most Linux distributions include Gimp. But if Gimp isn't already installed, it can most likely be installed by your Linux distribution application's installation tool. However, if you are working on, for example, an SGI workstation, Gimp will probably not be installed. Please read Obtaining Gimp to get a full explanation on how to install Gimp both as a binary and as a source on your system.

At the command prompt, type "gimp" and press Enter. If you've never used Gimp before, it will display the Gimp Installation dialog (as shown), which tells you that it will install some personal Gimp files in your home directory.

 
 

The dialog box also describes the Gimp license and what kinds of files Gimp will install. It's advisable to read it, but we will discuss these topics later in this chapter. If you want to run Gimp, press the Install button now!

After a short delay, you will see the Installation Log dialog box, informing you that all files were successfully installed.

 
 

A nice feature of UNIX is that programs often store personal initialization files and modules in your home directory. Then, you can change and add features to an application without having to modify the application at a system level. Gimp is no exception.

Unfortunately, most UNIX programs do not have a GUI for making adjustments to these files and modules. Here, thankfully, Gimp is an exception, because it includes a GUI for adjusting user-defined functions. However, there are some special functions (i.e., plug-ins) that you'll have to edit using a regular text editor.

After the file installation, you'll see a splash screen, along with a progress bar. The progress bar shows Gimp loading all its extensions, data and certain plug-ins.

Gimp In 256 Colors (Using An 8 Bit Display)

Does your 8 bit X11 system cause Gimp to crash just after displaying the splash screen? If it does, you'll need to configure Gimp to use a private color map. Using a private color map, you'll see color flashing as you move from window to window, but at least all possible colors will be available to Gimp.

To make Gimp use a private color map, you need to edit the gimprc file by hand (since Gimp won't start, you can't use Gimp's GUI). You'll have to do it in an xterm window (a terminal, console, etc.). Type in the command:

vi ~/.gimp/gimprc

This command starts the vi editor (however, you're welcome to use whatever editor you prefer). Move to the line # (install-colormap) by pressing the j key several times. When your cursor is placed over the # sign at the beginning of the line, press the x key and the # sign will be erased. Now type:

:wq!

This command will both save and exit the file. Gimp is now configured to work in an 8 bit display environment, and will not crash.

We would like to point out that if your system can only display 256 colors, you will never be able to access the full power of Gimp. Gimp will simply not display the colors as they would appear with 16 bit (or higher) color resolution. We therefore strongly suggest that you upgrade your graphic device to at least 16 bit.

Advice On System Resources

Since we only use Intel and SPARC hardware platforms running Linux and Solaris, we can only give advice on these platforms and operating systems. Our advice is also subjective, because it is what we consider to be the minimum or the recommended hardware for running Gimp.

On a Linux Intel platform:

· Minimum: Pentium 75, 32 MB RAM

· Recommended: Pentium 200, 64 MB RAM

Solaris Sparc platform:

· Minimum: SparcClassic, 32 MB RAM

· Recommended: Sparcstation 5 110 MHz, 96 MB RAM

Graphic device:

· Minimum: Frame buffer capable of 16 bit color at 800x600

· Recommended: Frame buffer capable of 24 bit color at 1024x768

What Are All These Files Used For?

Now, let's examine the files and directories that Gimp installed in your home directory. Gimp created the .gimp directory for its files.The dot indicates that .gimp is a hidden directory, and you have to use the ls -a command (as opposed to just ls) in a terminal window to see it. In this directory, Gimp created three files: gimprc, gtkrc and pluginrc, along with subdirectories called brushes, gradients, palettes, patterns, plug-ins, scripts, gfig, gflares and tmp. So, what are all these files for?

· gimprc and gtkrc are your personal settings files for Gimp and GTK+, respectively (GTK+ is Gimp's GUI toolkit). Most of the settings in these files are adjustable via the Preferences dialog box in Gimp, but some of them are not and must be edited by hand. The Preferences dialog box is discussed in Gimp Preferences.

· pluginrc is a file that Gimp needs to store settings about plug-ins, scripts and other external programs. You should not edit or change this file, but you may erase it if Gimp starts complaining about it.

· The brushes subdirectory is where you can store your own personally created brushes. You will learn how to create and install brushes in Brushes. Once you've installed one or more brushes (and have refreshed the Brushes dialog box) your personal brushes will show up in Gimp alongside the system-wide brushes.

· The patterns subdirectory is where you can store your own personal patterns. You will learn more about how to create and install patterns in Patterns. Like personal brushes, personal patterns will appear alongside the system-wide patterns after you've installed them, and have refreshed the Patterns dialog box.

· The gradients subdirectory is for storing your own personal gradients. You will learn more about how to create and install gradients in The Gradient Editor. Your personal gradients will show up in the Gradient Editor after refreshing the Gradients dialog box.

· The palettes subdirectory holds your own personal palettes as well as system palettes that you have edited. If you want your system default palette back, you have to rename or erase the copy in your personal palette directory. You will learn about creating, editing and installing palettes in Palettes. The new palettes will show up in the Palettes dialog after you quit and restart Gimp.

· The swap subdirectory stores the cache of the images you are working on. Gimp needs this cache in order to support the Undo capability, and to make it possible to edit large images without consuming too much memory. If Gimp crashes, or something else happens, you may be able to find a copy of your image in this subdirectory.

· The plug-ins subdirectory holds any plug-ins that you have created or downloaded off the Internet. New plug-ins show up the next time you start Gimp. You will learn more about plug-ins in Chapters 23 through 39, and in Compiling Plug-ins, we provide a few tips on compiling plug-ins.

· The scripts subdirectory holds any personal Script-Fus that you have created or downloaded off the Internet. The scripts will show up after an Xtns|Script-Fu|Refresh command. You will learn about Script-Fus in Script-Fu: Description And Function, and in Mike Terry's Black Belt School Of Script-Fu, you will find some tips on making your own Script-Fus.

· The gfig subdirectory holds your personal Gfig drawings (created with the Gfig plug-in). You will learn about Gfig in Gfig.

· The gflare subdirectory holds your personal Gflares (created with the Gflare plug-in). You will learn more about Gflare in Gflare.

The nice thing about all this is that if you find any new plug-ins, scripts and so on, you can easily install them in your personal Gimp directories, and don't have to beg your system administrator to install them for you.

We encourage you to create your own brushes, palettes, gradients, plug-ins and Script-Fus, and to share them with the whole Gimp community. Don't be shy; even small contributions are welcome.

You can upload them to ftp.gimp.org or to the Plug-in Registry at http://registry.gimp.org. May the spirit of free software be with you!

Obtaining Gimp

 

Gimp version 1.0 was released as a source distribution, but for some popular systems there may be binary distributions. To get the source code, FTP to ftp.gimp.org. The source code is in the directory /pub/gimp/v1.x/v1.0.X. 1.0.X indicates the version, and you should always get the latest version.

The directory /pub/gimp/fonts includes some nice free fonts that you can use with Gimp (see How To Get Fonts To Gimp for instructions on how to install them). The directory /pub/gimp/libs includes some of the libraries that enable some of Gimp's optional features, such as the ability to load and save JPEG images. The directory /pub/gimp/contrib contains some nice palettes, gradients, etc. If a binary distribution of Gimp exists, you'll find it under /pub/gimp/binary.

If you are not familiar with FTP, you can use your Web browser to download Gimp, just type the URL ftp://ftp.gimp.org/pub/gimp and go on from there. Realize that the Gimp FTP site is often heavily trafficked, and if ftp.gimp.org isn't near you, we suggest that you use a mirror site (see FTP or http://www.gimp.org for the nearest mirror sites).

Installing A Source Distribution

If you downloaded a source distribution, you should now have a file called gimp-1.0.X.tar.gz or a file called gimp-1.0.x.tar.bz2. (For binary distributions, see the next section.) If you want to, you can always get the extra data distribution as well as the unstable plug-in distribution (in the old Gimp distribution directory). The data distribution includes optional palettes, patterns, gradients and brushes that you may find useful. The unstable plug-in distribution contains some plug-ins that weren't considered stable enough to be released with Gimp 1.0, so remember that they may be unstable and difficult to compile. (However, we have used many of them with success here at Frozenriver, and they have also been documented in the manual.) You will find the unstable plug-ins under ftp.gimp.org/pub/gimp/v1.0/old/v1.0.0.

To unpack the archive, move to the directory containing the Gimp file you downloaded and type in the following command:

zcat gimp-1.0.X.tar.gz | tar -xvf

This command creates a subdirectory in your current directory called gimp. Change to the gimp directory by typing cd gimp.

Which Libraries Does Gimp Need?

If you don't have them already, you need to get the following libraries or programs:

· GTK+ (1.0.x), to compile Gimp. You need this library because all of Gimp's GUI and functions are built on top of it.

· GNU GhostScript, to enable PostScript file viewing and editing. Type gs -v to output the current version of your GhostScript distribution. If you receive an error message, either you have not installed GhostScript or it is not in your path.

· Aladdin GhostScript (version 5.50 or higher), to enable good PDF (also known as Acrobat) file viewing and editing. Type gs -v to output the current version of your GhostScript distribution. If you receive an error message, either you have not installed GhostScript or it is not in your path. (Aladdin is an earlier version of the GNU GhostScript.)

· GNU wget, for downloading files off the Internet directly into Gimp. To check whether you have wget, type wget into a terminal window. If you receive an error message, either you have not installed wget or it is not in your path.

· xv, if you want to use Guash. Guash is a Gimp plug-in with a GUI interface for browsing and opening images. Guash uses xv to create its thumbnail images.

· gzip, to enable extra file compression/decompression of any image format. To check whether you have gzip, type gzip -h. If you get an error message, either you have not installed gzip or it is not in your path.

· bzip, to enable extra file compression/decompression of any image format. To check whether you have bzip, type bzip -h. If you receive an error message, either you have not installed bzip or it is not in your path.

· SANE, if you want to scan images directly into Gimp.

· libtiff, to enable reading and writing of TIFF images.

· libz, to enable PNG compression.

· libpng, to enable reading and writing of PNG images.

· libjpeg, to enable reading and writing of JPEG images.

· libmpeg, to enable reading of MPEG movies.

To determine whether you have these libraries, look in /usr/lib or /usr/local/lib, or contact your system administrator. Most of the programs and libraries come as standard with most Linux distributions, with the possible exceptions of GTK+, Aladdin GhostScript, SANE, wget and bzip.

Remember that even if you have the libraries you must also have the header files to compile Gimp. It's very common to divide, say, a libtiff package into a library package and a header package (development package). So please make sure that you have the header (development) package installed.

Let's Begin To Build Gimp

First of all, fire up a new xterm window using your window manager or via the command:

xterm -sl 200 -sb &

In the new xterm window, move to the directory where you put the Gimp files. Then, type in the command:

./configure

This command will try to locate the files that Gimp needs in order to compile. Now, scroll up and find out if the configure program could find all of the files. If not, you will have to tell the configure program where to find the missing files. For example, if your system couldn't locate the libtiff and libjpeg files, you can do this by adding the following additions to the command-line:

--with-libtiff=<path to your tiff library>

--with-libjpeg=<path to your jpeg library>

--disable-debug

(If you are a user and not a developer, you want to turn off debugging. Debugging is turned off by default).

So, the command line might look something like this:

./configure --disable-debug --with-libtif=/usr/local/lib/tiff/

After the configure command has properly executed, you'll need to type in the command:

make

make will build your Gimp application. (If you're having problems, you will find more information on compiling in Compiling Plug-ins.)

If there were no errors, Gimp built successfully, and you can install it. To install Gimp, enter the command:

make install

make install will, by default, install Gimp in /usr/local/bin, the Gimp plug-ins in /usr/local/lib/gimp/1.0 and shared data like scripts, brushes and configurations in the /usr/local/share/gimp/ directory.

You are allowed to install Gimp in directories other than the ones mentioned above. To do so, read the INSTALL file and use the specified command-line options for the configuration program (in particular, --prefix).

Once you're done, go back to the first section in this chapter and read about how to install your personal Gimp files.

Installing A Binary Distribution

First of all, get the latest binary distribution for your system -- download it from the Gimp FTP site or a mirror site. If you are working on a Red Hat Linux or Debian system, download the packages appropriate for your system (.rpm and .deb respectively); otherwise, download an ordinary tar.gz archive and unpack it into the correct directory (usually /) using the command:

gzip -dc xxxx.tar.gz | tar xvf

Make sure that Gimp is in your path and execute it (type in gimp and see if it works). Then, go back to the beginning of the chapter, to where personal Gimp files are discussed.

If you have bought the printed version of this book, you will find an enclosed Gimp CD-ROM compiled for Linux and Solaris systems.

Installing Extra Packages To Extend Gimp

To install the extra data distribution you only have to download it. Unpack it, run the configure script and do a make install.

You may also consider downloading and installing the contrib archive, to install more brushes, gradients, etc. You only have to download it, unpack it and install the contents in the right directory. You can install new brushes either in your personal brush directory (~/.gimp/brushes) or in the system-wide directory (usr/local/share/gimp/brushes). Some of the contribution archives come with configure scripts; if that is the case, you install them as you installed Gimp. Since it is only data, it should be quite simple. Just type:

./configure && make install

Most of the time this will install the data distributions correctly.

It's a good idea to download the freefont and sharefont archives, so you can get some more fonts for Gimp. Read about how to install them in How To Get Fonts To Gimp.

Extra Plug-ins

Many of the plug-ins described in GUM are not found in the standard Gimp distribution. They are either in the gimp-plug-ins-unstable distribution or at the plug-in registry (http://registry.gimp.org).

We don't want to recommend that you download all of the extra plug-ins available for Gimp (they are quite numerous). If you don't, you will most probably lack some of the filters described in the manual, or have an older version of the plug-in. Most of the time you have to compile these plug-ins by hand; no binary distribution or configure scripts are available. But if you find an interesting plug-in in this book that you don't have, don't hesitate to download it and install it.

On the other hand, when you installed Gimp, a second program called gimptool was also installed. Gimptool makes it easy for you to compile plug-ins for Gimp. Read more about gimptool in Compiling Plug-ins and The gimp-tool Man Page. So, if you don't have a plug-in (or a filter) that is described in the GUM and you would like to get it, you'll need to download and compile it.

Note that many of the plug-ins are beta software and can be considered unstable, but most of them are (as usual in the UNIX world) of very high quality, and we have encountered very few problems (compared to the bugs in commercial alternatives).


prevnext


Frozenriver Digital Design
http://www.frozenriver.nu
Voice: +46 (0)31 474356
Fax: +46 (0)31 493833
support@frozenriver.com
Publisher Coriolis
http://www.coriolis.com