Learning Linux

Part 3 - Introduction to the GIMP

What is GIMP?

GIMP, sometimes called The GIMP, is the GNU Image Manipulation Program. It is the premier open source image editing program. GIMP can read practically any graphical image file and can also save to practically any image format. You can also use GIMP to create your own images.

GIMP is a powerful image editor that can do just about everything that PhotoShop can do.

GIMP Windows

Up until version 2.8 of GIMP, the program was organized as a series of separate windows. With version 2.8, those separate windows are now incorporated into a single window. If you have version 2.8, when we talk about windows here, just think of them as 'panes' instead.

GIMP is organized into several separate windows. They consist of the Toolbar window, the Layers window and one or more image windows.

Toolbar Window

The Toolbar window contains icons for the painting tools used in GIMP. The Toolbar is the heart of GIMP.

Figure 1. Toolbar Window

When you click on a tool icon, the Tool Options changes to reflect options for that particular tool. There are tools for selecting, changing and painting images. Figure 1 shows the Paintbrush selection and its options. Here is a list of tools in version 2.6:

Layers Window

The Layers window contains information and tools about image layers, channels, paths, undo history, brushes, patterns and gradients.

Figure 2. Layers Window

The Layers window has two sections and the two sections each have multiple tabs. The upper section consists of the layers, channels, paths and undo history dialogs. The lower section consists of the brushes, patterns and gradients dialogs. Figure 2 shows the Layer window with the Layers and Brushes dialog shown.

Image Window

The Image window for GIMP, shown in Figure 3, is the main window. It resizes itself, depending on the size of the image on which you are working. If the image is too big to fit on your display, GIMP will automatically zoom out the image so it does fit on the display. The Image window menu contains all the commands and tools for GIMP. The menu items are

Figure 3. Image Window

GIMP and Layers

The GIMP uses an internal image format that supports layers. Layers allow you to work with small bits of an image without affecting the rest of the image. It does this by putting pieces of the image in each layer. The layers are usually transparent and they lay on top of one another so that when you view the image, you can see the whole thing.

Figure 4. Layers Layout

You can disable layers and change their order. You can also delete a layer or add a new layer if you wish. Selecting a layer allows you to use the editing tools to make changes to that layer.

Some image file formats support layers, while others do not. If you save an image you are working on to a flat file format, GIMP will merge all the internal layers into a single layer and will save that single layer to the file. This is a good way to distribute an image, but it is harder to work on the next time you want to change it.

GIMP and Photos

GIMP is well suited to making changes to digital photograph files. It has all kinds of tools to help you modify your photo images. You can change the size of a photo and you can make the photo darker or lighter. You can also change the color balance of the photo if necessary.

Changing the size of a photo image

When I take pictures with my digital camera, I use the highest resolution possible when the image is saved. This allows me the maximum flexibility when it comes to using the image. The current resolution I take pictures at is 3648 X 2736. I can't post pictures with that resolution on my web site, so I use GIMP to reduce that size to 1024 X 768. That reduces the image to something anyone can view. Additionally, it reduces the file size so the image loads in a web browser much faster.

To reduce the size of a photo image, load the image into GIMP, then select Image | Scale Image from the menu. You will now see the Scale Image dialog.

Figure 5. Scale Image dialog

Note that there are some chain links next to the width and height indicators. Having them linked means that changes to the width will automatically change the height, and vice versa. We will now change the width of the image to 1024.

Figure 6. Scale Image dialog after changing width

Note that GIMP automatically adjusted the height to preserve the aspect ratio of the image.

One thing you should know about this dialog - when it is finished, the picture will be displayed in the GIMP image window, but if you reduce the image size, it will be shown as being smaller. Basically, GIMP has changed the image size, but not its display size. You can change the display size yourself to get a better feeling of what the new size will really look like.

When you are finished changing the image size, be sure to save your work. I recommend you save the image to a new file by using File | Save As. Do this because once you have overwritten the original file and close the GIMP image window, you can't get the original image back.

Changing the light levels of a photo image

It is often possible to snap a photo that comes out too light or too dark, with either an analog or a digital camera. Once the photo is in the computer, you can use GIMP to adjust the light levels of the photo so it looks much more normal. To do this, load the image into GIMP and select Colors | Levels (or Tools | Color Tools | Levels). The Levels dialog will be displayed.

Figure 7. Levels dialog

Note that the picture we are attempting to adjust has a histogram that is heavily weighted towards darker colors. To adjust the levels, we can move the slider towards those colors, thereby adjusting the the image to be lighter (in this case).

Figure 8. Image before and after level adjustment

Changing the color balance of a photo image

Back in the analog photography days, it was quite possible to take pictures that had one color over another be predominant over the whole picture. There are a lot of reasons that the problem occurs, but if the photo is digitized, GIMP can handle the color changes and make the photo look much better.

There are several ways to alter the color balance of an image. You can use Colors | Color Balance, Colors | Curves or Colors | Levels. The first two are completely manual and are very hard to use. The third one is a snap to use.

If you look back at the Levels dialog (figure 7), you will see a section called All Channels. A channel is a specific color for an image. There are three channels: red, green and blue. Anyway, in that section you will see a button called Auto. If you click the button, GIMP will make a best guess as to the real levels for the colors of a photo. It does a pretty good job.

Figure 9. Image before and after color adjustment

<< Part 2: Using the Linux GUI | >> Part 4: More of the GIMP