Example advert

Using the GIMP

../../Images/theGIMP.jpg
This tutorial will show you how to make basic modifications to an image. These include rotating, cropping and scaling an image, reducing an image's file size, and creating a transparent background. The guide's choice of image processing software is the GIMP.
The GIMP is capable of much more than I can show in this short tutorial, the aim here is to introduce the program to you, without introducing too many concepts (such as layers and paths) which would be needed to produce professional graphic designs.
If you haven't already downloaded and installed this program, the guide's article The GIMP - Image Processing will show you what to do.

Rotating, Cropping and Scaling an Image

For this example I'll use a photograph of my dog, taken with the built in camera of my mobile telephone. Once downloaded to the computer, double click on the file from within Explorer to see the image in the GIMP:
ImagesUsingTheGIMP/PhotoEdit-1.jpg
RGB Mode
The above picture shows the GIMP in RGB mode – note the RGB in the title. There are also greyscale and indexed modes, but many of the tools cannot work in these modes. So, if a tool is greyed out, check that you are in RGB mode, and if not change to this mode; from the image window, click on Image, then Mode, then RGB.
Firstly, I want to get the image the right way round. The GIMP provides quick commands from the image window menu bar to achieve this. Click on Image, then Transform, then Rotate 90 degrees CCW (CW is clockwise, CCW is counter-clockwise, or anti-clockwise).
This type of rotation doesn't alter the quality of the image, because it just moves the pixels. At this point, I noticed that the floor tiles are not aligned with the border of the picture, as you can see below. To realign the tiles, I need to do a fine grained rotation. Click on Tools, then Transform Tools, then Rotate.
I can now rotate the image even by fractions of a degree. However, this is achieved by making calculations on how much of each surrounding original pixel will be applied to each new pixel, which can cause a reduction in quality. Fortunately, the GIMP gives you a preview of the operation, as you make changes to the angle:
ImagesUsingTheGIMP/PhotoEdit-4.jpg
When you're satisfied with the result, click on Rotate to make the changes permanent.
Now that the image is nicely lined up, I want to concentrate on the dog, so I'll crop away the surroundings. Click on Tools, then Transform Tools, then Crop & Resize.
Now move the mouse to where you want to start the top left edge of the area to crop, press (and keep pressing) the left mouse button, and move to the bottom right of the crop area:
ImagesUsingTheGIMP/PhotoEdit-6.jpg
The Crop & Resize tool also provides a dialog, so that you can move the crop area with pixel precision:
ImagesUsingTheGIMP/PhotoEdit-7.jpg
Once you're happy with the cropped area, click the Crop button to make changes permanent. The resulting image now contains only the cropped area.
The image is still too big for publishing on the web, at 732 by 516 pixels (see above). I used the scaling tool to reduce the pixel size of the image by clicking on Image, then Scale Image...:
ImagesUsingTheGIMP/PhotoEdit-8.jpg
The little chain symbol to the right of the width and height input boxes ensures that the scaled image will keep the same aspect ratio. I changed the units (on the right) to percent, as I wanted to reduce the image to half its original size.
The resolution values in the dialog specify the printing density. I kept these values fairly small, so that if I insert the image in a OpenOffice.org Writer document it won't appear too small, and will still print reasonably well.
When you've finished adjusting the scaling parameters, click on Scale to make the changes permanent.
Unfortunately, there wasn't much light when I took the photograph, and the image looks far too dark. The GIMP provides a large range of colour transformation tools, but I'll use one of the easiest, which adjusts brightness and contrast. Click on Tools, then Colour Tools, then Brightness‑Contrast...:
ImagesUsingTheGIMP/PhotoEdit-9.jpg
Make sure that the Preview check box is checked, so that you can see the results in the image window. I adjusted the Brightness and Contrast sliders until I was satisfied, then clicked on OK to make the changes permanent.
All that remains now is to save the new image to disk. Saving and reducing the image's file size is covered in the next topic.

Reducing an image's file size.

All of the modifications above helped me reduce the original file from 317KB to 16KB, which is probably good enough. However, some image file formats (particularly JPG and PNG), allow you to use lossy compression to further reduce the file size. Obviously, with a lossy compression, the smaller the file size, the lower the image quality, and vice versa.
Within the image window menu bar click File, then Save as...:
ImagesUsingTheGIMP/PhotoSave-1.png
I changed the filename to Cropped, then clicked on the Select File Type element to display the list, then chose JPEG image. Click on Save. If the image in memory has attributes which can't be saved in the file format, the GIMP will warn you, and take the appropriate actions:
ImagesUsingTheGIMP/PhotoSave-2.png
Click on Export.
Now the GIMP will display a dialog (which may differ slightly, depending on the file format you're saving to), which will allow you to change the compression level before saving:
ImagesUsingTheGIMP/PhotoSave-3.jpg
Make sure the Show Preview in image window box is checked, so that you can see the effects of changing the quality level. The dialog box also shows the final saved file size.
I reduced the quality level from the default 85% to 75%, reducing the image size to 11KB. Below this level I found that the reduced quality of the image was noticeable, leaving blotches, especially around the bottom left of the image.
Click on OK to save the image with the desired quality level. The resulting final image looks like this:
ImagesUsingTheGIMP/Cropped.jpg

Creating a transparent background

Company logos are usually have a solid coloured background. This background can be a problem when you want to superimpose the image, either as a drawing or a web page. Preferably, the background should be transparent so that the drawing or web page background shows through.
ImagesUsingTheGIMP/syger-logo.png
The GIMP has a very useful tool to achieve this very quickly. Open the logo in the GIMP, then, in the image window, click on Layer, then Transparency, then Colour to Alpha.... This will open the Colour to Alpha dialog:
ImagesUsingTheGIMP/AlphaEdit-2.jpg
Make sure that the Preview box is checked, so that you can see changes immediately. As shown, the GIMP makes a good attempt at finding the background colour, and setting it to transparent on its own.
If, however, you're not satisfied, you can set the transparent colour yourself, using the colour picker tool (the eye dropper):
ImagesUsingTheGIMP/AlphaEdit-3.jpg
Click on the background, and the Colour Picker dialog will appear. As you can see in the main toolbar window, this has also set the background colour.
Now go back to the Colour To Alpha dialog, right click over the From button, then choose Background Colour:
ImagesUsingTheGIMP/AlphaEdit-4.jpg
Click on OK when you are satisfied.
Save the modified image in either GIF or PNG format, as these both store the transparency colour. The resulting logo with transparent background now looks like:
ImagesUsingTheGIMP/syger-logo-transparent.png

Conclusions

The GIMP is a powerful, but complex program, which requires that you understand certain concepts, particularly layers and channels, to make the most advantage of it. Be prepared to spend some time learning and experimenting.
Make a Donation
If you find the GIMP to be an important office application to you, think about making a donation to the developers.

Further Reading

The built in documentation, available by pressing F1, or, in the GIMP window, clicking on Help, then Help, gives a brief overview of the tools available.
The GIMP web site has a section dedicated to documentation, which includes the user's manual. This manual is available online and in PDF format. There is also a section on tutorials.
Carey Bunks' book “Grokking the GIMP” is available as a downloadable archive of HTML pages.
There are also several user groups and communities on the web, including GIMPguru.org, GIMP Tutorials, GIMPtalk, and GIMPusers.com.

AddThis Social Bookmarking  Valid CSS   Valid XHTML 1.0   Valid Atom 1.0   Atom 1.0 Feed

Example advert

Support the Guide