Introduction to the GNU Image Manipulation Program (GIMP)


Revision 1.1

July 26, 2010



by

Aloysius Indrayanto



(C) 2010 AnemoneSoft.com


This document is multi-licensed under the Creative Commons Attribution Share-Alike (CC-BY-SA) license version 3.0 and the GNU Free Documentation License (GNU FDL) version 1.3 or later.



1. Introduction

The GIMP (GNU Image Manipulation Program) is a free and open source raster-graphics editor software. It was originally an acronym for General Image Manipulation Program. GIMP was created as a semester-long project at the University of California, Berkeley by Spencer Kimball and Peter Mattis in 1995. GIMP made its first public release (version 0.54) in January 1996. Due to its great potential, GIMP became a part of the GNU Project in 1997. Hence, the the acronym was changed to the GNU Image Manipulation Program. Currently, it is maintained and developed under the support of the GNOME Project. The official mascot of GIMP is Wilber. It was created by Tuomas Kuosmanen at some point before September 25, 1997. Now, the mascot comes in various variants with additional accessories.

The original version of GIMP supports Linux, SGI IRIX, and HP-UX. Nowadays, it has been ported to many operating systems including Windows and Mac OS X. The original Win32 port was started by Tor Lillqvist in 1997 and become available with the release of GIMP 1.1. The first release of GIMP used Motif as its Graphical User Interface (GUI) toolkit. Motif is a GUI toolkit that emerged in the 1980s when the popularity of Unix workstations was on the rise. Due to its classical looks, Motif soon become unappealing to the GIMP developers. Hence, Peter Mattis developed his own GUI toolkit named the GIMP toolkit (GTK). Since version 0.60, GIMP has use GTK as its GUI toolkit. Starting from version 0.99, GIMP used the new object oriented version of GTK (called GTK+).

GIMP provides many features that are usable by both amateur and professional raster-graphics designer/artists. GIMP is designed to be expandable and extensible by using plugins and extensions. GIMP has an advanced scripting interface to allow automation for both simple and complicated image manipulation processes. A partial list of GIMP features is shown below (taken from http://www.gimp.org/about/introduction.html):

2. Requirements

A basic knowledge in using a personal computer and applications will be needed to understand the topic discussed in this tutorial. A system with an installation of GIMP 2.6.x will be also needed to try the examples.

3. GIMP Basics

GIMP is packaged (included) by almost all Linux distributions. However, in case it is not installed by default, it can be installed by using one of these methods:

GIMP utilizes the concept of Single Document Interface (SDI). Hence, GIMP has a main window and several additional windows for toolbox, color palette, layer, etc. The responsibility to manage those additional windows are left to the operating system's desktop environments. GIMP will only tell the desktop environments about how to handle its windows.

The picture below shows the toolbox of GIMP 2.6.7 with the Paintbrush Tool active. The top part of the toolbox contains buttons for the available tools and the currently active (used) colors. The bottom part of the toolbox contains settings for the active tool. At the bottom-most part of the toolbox, there are buttons to manage the settings (save, restore, delete, and reset). The default foreground and background colors are set to black and white. These colors can be easily swapped by clicking the double-headed arrow. From top to bottom and left to right, the available tools are:

The picture below shows an empty GIMP workspace that will be displayed when the application is started. GIMP may also display other dialogs such as “Tip of the Day”, “Layers”, etc. Those dialogs can be safely closed for now.

4. Basic Image Operations

To open/load an image file, click 'File/Open' or press 'Ctrl+O'. For this section of the tutorial, open the 'wilber.png' file (the official mascot of GIMP).

The file will be opened on the previously empty workspace. You can resize the workspace window by using the usual method to resize a window.

On some occasion, it is possible that the loaded image may appear too large or too small. To adjust the image zoom level, click 'View/Zoom' and select one of the available zoom levels. One may also use the keyboard shortcut '+', '-', and '1' to zoom in, zoom out, and zoom to 100%. Zooming by using 'Ctrl + Mouse Wheel' is also supported. Scrolling the wheel up will zoom in the image while scrolling the wheel down will zoom out the image.

Sometimes, one may want to take only a part of the image. To crop to a rectangular area from an image, you need to first select the area of interest. Activate the Rectangle Select Tool and click on the first point of the rectangular area. Next, drag the mouse pointer to the second point and release the button. This operation will select a rectangular area on the image.

Now click 'Image/Crop' to Selection' to crop the image to the rectangular area.

If you would like to remove the empty/transparent/background area around the image, click 'Image/Autocrop Image'. The image will no longer have an empty bordering area. Note that for this operation to work, the bordering area must really contains the same pixels/colors.

To scale an image, click 'Image/Scale Image'. A setting dialog will be shown. The new image size can be specified in pixels, percent, inches, millimeters, etc. The X and Y resolution will not scale the image, they will just modify the image's resolution information. The available interpolation methods are 'None', 'Linear', 'Cubic', and 'Sinc (Lanczos3)'.

For now, just change the image width to 120 pixels and leave the other settings in their default values. Notice that the image height will be proportionally adjusted. If you would like to scale the image's width and height separately, click the chain icon besides the image size to turn it into a broken chain icon. Click the 'Scale' button to confirm the settings and scale the image. You will find that the image now is about 50% smaller.

GIMP supports many image file formats. To save the scaled image to another file, click 'File/Save As'. Just type the new file name with the complete extension of the file format. If you do not know the file extension of a particular format, just write the new file name without extension and select the file format by the clicking and expanding the 'Select File Type' list on the bottom left section of the dialog. For now, just save it as a bmp (Windows Bitmap) file by naming the file to 'wilber.bmp'. Click the 'Save' button to save the file.

To close the current workspace (image file) click the usual 'X' button of the workspace window (it is usually located on the top-right section of a window). To exit the GIMP, close the toolbox by clicking its 'X' button. Closing all open files as well as the last empty workspace will also produce the same result.

5. Creating New Image and Adding Text

Create a new image by clicking 'File/New'. Set the width and height of the image to 256 pixels. Expand the 'Advance Options' and change the 'Fill with' setting to 'Transparency'. Click the 'OK' button.

To add text, activate the Text Tool and click anywhere in the workspace of the newly created image. Insert whatever text you like. The text will be displayed on a “Text Editor” dialog as well as on the workspace.

     

You can change the settings of the text by modifying parameters on the toolbox.

     

GIMP stores text in its own layer. Hence, it can be edited again later. However, the image file must be saved in the GIMP's own format (xcf), otherwise the text will be converted to a normal raster image. If any additional processing (rotation, color adjustment, filters, etc.) is applied to the text layer, it will be also converted to a normal raster image (it cannot be edited again). If the “Layers” dialog is not shown, click 'Windows/Dockable Dialogs/Layers' to show it. You can see that the text is in its own layer. Try to experiment by adding more text with different parameters.

To edit an existing text, follow the procedure shown below (note that sometimes, this procedure can be a bit tricky):

  1. Activate the Text Tool ;

  2. Select the text to be edited by selecting its layer from the “Layers” dialog;

  3. Click again the same text that is shown inside the workspace.

6. Selections

For this section of the tutorial, open again the 'wilber.png' file. There are three modes of selection:

First, activate the Rectangle Select Tool and select some part of the image. Next activate the Ellipse Select Tool and use it to add a new elliptical area to the current selection (by holding 'Shift' while selecting the area). Finally, use the same tool to subtract an elliptical area from the current selection (by holding 'Ctrl' while selecting the area). Refer to the picture below for hints.

Now, hold 'Shift+Ctrl' and make a new selection area that cover both an already selected area (the existing selection) and a non selected area. Notice that the final selection area is the intersection between the existing and new selection area.

To invert the selection area, click 'Select/Invert' or press 'Ctrl-I'. The result may cannot be seen clearly, but notice that the animated selection-line has changed. Try to repeat the process several times to see the differences.

The Free Select Tool (sometimes also called as the Lazzo Select Tool) can be used to select an area with arbitrary shape. You can click and drag the mouse pointer to make a selection, or, define multiple points to form a polygon. To close the area, you can either click/drag to the starting point/position or double-click on the workspace.

The Fuzzy Select Tool (sometimes also called as the Magic-Wand Tool) can be used to select a whole contiguous area. Its sensitivity can be modified from its parameters on the bottom part of the toolbox. For now, set the 'Threshold' to 50.0 and click in the middle of the white dot on the Wilber's nose. The whole dot should be completely selected.

The Color Select Tool can be used to select all area with similar colors. Its sensitivity can be modified from its parameters on the bottom part of the toolbox. For now, set the 'Threshold' to 75.0 and click on the Wilber's head area, halfway between the right eye and ear. Try to experiment with the parameters and the clicked location to observe the effect.

Before continuing to the next section of the tutorial, click 'File/Revert' to revert the file to its original state. This operation will revert any changes that have been made to the image from the last time it was opened/saved.

7. Layers and Filters

Layers can be managed from the “Layers” dialog. The dialog supports these layer management operations:

A floating layer, is a temporary layer which is created when you copy a selection area (using 'Ctrl+C') and paste it in the workspace (using 'Ctrl+V'). A floating layer is bound to the active layer on where it was pasted. Anchoring a floating layer means combining its content (image) to the active layer. Despite using the “Layers” dialog, a floating layer can also be anchored by clicking on the workspace area outside the boundary of the pasted layer (image).

Now, with the 'wilber.png' file opened on the workspace, go to the “Layers” dialog and duplicate its background layer by clicking . The “Layers” dialog should now look like the left-side picture shown below.

     

Check the toolbox and ensure that the foreground color is set to black (refer to the right-side picture shown above). Select the 'Background' layer and create a new layer by clicking . Follow the settings shown in the “New Layer” dialog below and click 'OK' to confirm it.

Click to lower the newly created layer. The “Layers” dialog and the workspace should now look like the pictures shown below.

     

For safety, click 'File/Save As' and save the file as 'wilber.xcf'. Note that it is important to save the file using GIMP's own format (xcf) so that all the processing information can be preserved. Only export (save) the final image to other formats (png, jpg, etc.), after all processing have been done.

Now, from the “Layers” dialog, select the 'Background copy' layer and change its 'Mode' to 'Screen'. Next, sets its 'Opacity' to 75.0. Finally, click 'Filters/Blur/Gaussian Blur' and set the 'Blur Radius' to 25.0. Click 'OK' to confirm. Notice that Wilber now has a soft glow.

     

With all processing completed, you can save the final image to other format such as png, jpg, etc. Note that if the target format does not support layers, GIMP will ask if you would like to 'Flatten Image' or 'Merge Visible Layers' (the second method is usually better). If the target format does not support transparency, only 'Flatten Image' is available.

Note that some image format (for example: jpg), may have additional settings as shown in the picture below.

8. More Filters

In this section of the tutorial, we will be using a butterfly photograph that was downloaded from Public Domain Free Stock Photos (http://www.republicdomain.com). As per July 24, 2010, the site states that:

All photos on this web site are public domain. You may use these images for any purpose, including commercial.”

The quality and size of the image used in this tutorial have been reduced to save space, however, the original image should be download-able using the direct link:

http://www.photos8.com/wallpapers/butterfly_blue_flowers-800x600.jpg

Public domain does not mean that anyone can just take the material and then (re-)copyright it. According to the site, the photographs are in the public domain and that they should stay that way.

In this section of the tutorial, open the 'butterfly.png' file and follow the examples shown in the following tables. Do not forget to revert the image to its original condition by clicking 'File/Revert' before trying the next example.

Filter

Parameters

Values

Result

None (original image)

N/A

N/A

Filters/Blur/Motion Blur

Blur Type

Zoom

Blur Center

200, 150

Blue outward

No

Length

35

Filters/Distorts/Waves

Mode

Smear

Amplitude

5.0

Phase

0.0

Wavelength

20.0

Filters/Light and Shadow/Lens Flare

Center of Flare Effect

350, 50

Filters/Noise/Spread

Spread Amount

10, 10

Filters/Artistic/Soft Glow

Glow Radius

10.0

Brightness

0.75

Sharpness

0.85

Filters/Decor/Fuzzy Border


Note:

This filter can be set to work on the original image or on its copy (by using the 'Work on Copy' parameter).

Color

White

Border Size

20

Blur Border

Yes

Granularity

5.0

Add Shadow

Yes

Shadow Weight

50

Work on Copy

Yes

Flatten Image

Yes

Filters/Map/Illusion

Divisions

4

Mode

1

Filters/Render/Line Nova


Note:

This filter is affected by the current foreground color.

Number of Lines

300

Sharpness

1.0

Offset Radius

100

Randomness

100

Try to experiment with the above filters by changing their parameters. Try also to experiment with the other filters.

9. Some GIMP 2.6.x Keyboard Shortcuts

Shortcut

Function

Ctrl+N

File/New

Ctrl+O

File/Open

Ctrl+Alt+O

File/Open as Layers

Ctrl+S

File/Save

Shift+Ctrl+S

File/Save As

Ctrl+W

File/Close

Shift+Ctrl+W

File/Close All

Ctrl+Q

File/Quit

Ctrl+Z

Edit/Undo

Ctrl+Y

Edit/Redo

Ctrl+X

Edit/Cut

Ctrl+C

Edit/Copy

Ctrl+V

Edit/Paste

Delete

Edit/Clear

Ctrl+A

Select/All

Shift+Ctrl+A

Select/None

Ctrl+I

Select/Invert

-

View/Zoom/Zoom Out

+

View/Zoom/Zoom In

1

View/Zoom/1:1 (100%)

Shift+Ctrl+E

View/Zoom/Fit Image in Window

Ctrl+D

Image/Duplicate

Shift+Ctrl+N

Layer/New Layer

Shift+Ctrl+D

Layer/Duplicate Layer

Ctrl+H

Layer/Anchor Layer

Ctrl+L

Windows/Dockable Dialogs/Layers



References



http://en.wikipedia.org/wiki/GIMP, July 21, 2010

http://en.wikipedia.org/wiki/Motif_(widget_toolkit), July 21, 2010

http://www.gimp.org/about/introduction.html, July 21, 2010

http://www.ischool.utexas.edu/technology/tutorials/graphics/gimp, July 21, 2010

http://www.republicdomain.com, July 24, 2010