SoSLUG Archive

Image Editing with the GIMP

Image Editing with Gimp

Introduction

Gimp is an image editor which is as powerful as Photo Shop but has the great advantage of being free whereas Photo Shop will cost you many hundreds of pounds. The other advantage is that Gimp will work not only with Linux based operating systems, with which we are primarily concerned, but also with Windows and Macs .

Accordingly, we are proposing to explain just how simply Gimp works by working through various examples and our comments will apply irrespective of the operating system you are using. As Linux users ourselves we shall refer, if necessary, to the Linux Ubuntu 10.10 operating system.

Firstly, for those of you who do not have Gimp loaded onto your computer you can find versions for Linux, Windows and Mac operating systems at www.gimp.org. For Linux users, particularly Ubuntu 10.10, Gimp can also be downloaded from Applications/Ubuntu Software Centre/Graphics/Gimp. Alternatively, open a Terminal window and type,

#> sudo apt-get install gimp

and press enter. When requested enter your password and again press enter. Gimp will be loaded onto your computer. Once loaded Gimp can be found under Applications/Graphics.

We would also recommend you install the following which, whilst not essential to this tutorial it does extend the number of different filters and features available.

#> sudo apt-get install gimp-plugin-registry

If you now open Gimp you will see three panels, one on the left, one on the right and one in the centre. The left panel has two sub-panels, an upper Tool panel and a lower Tool Option panel. In the Tool panel there are a number of icons each representing a tool to be used and when you click on a tool various options appear for that tool in the Tool Options panel. Try clicking on the icons and you will see the options change as different icons are selected.

The right hand panel is also split into upper and lower panels with the upper panel used to control Layers, Channels and Paths relative to an image. The lower panel allows you to select a particular type or size of brush, patterns or gradients when the appropriate tool icon is selected.

The central panel is the Image panel and it is here that an image is located to be worked upon. In my version of Gimp (2.6) the Image Panel is screen width and the Tool panel and Layer panel overlie the Image panel on opposite sides of the screen.

Now to illustrate just how Gimp works it is proposed to show you a number of basic operations which can be applied to an image. So firstly click on File on the Image panel and Open, then navigate to an image you wish to alter, highlight it, then open it and the Image will appear in the Image box. Alternatively, you can open the image in a separate window and drag and drop it into the Image panel.

Now before starting it should be mentioned that throughout the description that follows refererence is made to various tools you will find in the Toolbox panel. Looking at all the icons you may say well which is which? Firstly you will learn what the icons mean with use but in the meantime simply hover your mouse pointer over each icon and it’s description will appear.

Scaling

The image chosen for this workshop is shown in Figure 1 and the first thing that can be done, if necessary, is reduce or enlarge the size of the Image. To do this click on the scaling tool in the Tool Panel and then click on the image. The image originally imported will of course just be the image but Figure 1 shows not only the image but also what you will see after you have applied the scaling tool as just described. The little square boxes around the image are control handles and by grabbing any of these you can resize the image. Once you have the image to the size you require click Scale in the scaling box which appears separately and is shown at the top left of Figure 1.

Figure 1

Figure1

The scaling panel appears once you have clicked on the image after selecting the scaling tool and with which you can change the Width and Height figures to achieve incremental rescaling. However, to maintain proper perspective known as (aspect ratio) within the image it is advisable to lock the perspective option by clicking on the button shown by the pointer in Figure1. Once satisfied click the scale button and you will see something similar to Figure 2 with the image surrounded by a chequered surround indicating transparency. To remove this go to Image and then Fit canvas to layers. The image will then appear as shown in Figure 3 but without the Cropping features to be discussed in the next paragraph.

Figure 2

Figure2

Cropping

After viewing the Image you may wish to remove the people from the bottom right hand corner of the image and to do this click on the Cropping tool (hover the pointer over a tool to get it’s description), then click on the image and drag the marker around that part of the image you wish to retain. Let go the mouse button and you will arrive at Figure 3 as shown with the part to be deleted shown in shadow. Click on the image and the result is shown in Figure 4.

Figure 3

Figure3

Figure 4

Figure4

Cutting

Now it’s sometimes needed in photo editing to want to take out something from an image and perhaps insert it into another image or replace the original with something else. This can be achieved by a process know as cutting (with transparency). So in Figure 5 the tower to the right of the image is selected by clicking the Path tool in the Tool panel and then clicking on the image at various points along the outline of the tower, remembering as the last click to click the point where you started, see Figure 5. Now go to the Select menu and select From Path(Shift V). Now go back to the Select menu, select Invert (Ctrl I) and then Delete. These two selection steps ensure that when you Delete you delete everything outside the path leaving the item you have selected on a transparent background, Figure 6.

Figure 5

Figure5

Figure 6

Figure6

Moving

The removed part can be moved about by selecting the Move Tool and any transparency can be removed by going to Image/Fit canvas to layers, Figure 7.

Figure 7

Figure7

Flipping

The image may be flipped by selecting the Flip Tool from the tool panel and clicking the on the image, Figure 8. Click again and the image flips back.

Figure 8

Figure8

Rotation

Rotation of the image can be achieved by selecting the Rotate Tool from the tool panel and clicking on the image, a Rotate Box then appears with a slider which once grabbed can be moved back and forth to rotate the image, Figure 9. Just above the slider is a box where an angle of rotation can be pre-set. In either event, once the required rotation is achieved simply click the Rotate button in the Rotate Box and the rotation is effected.

Figure 9

Figure9

Reduction of file size

Ignoring Layers for the moment we have covered above most of the basics for using GIMP other than reducing the file size and saving. To illustrate this you are referred to the image shown in Figure 10 which is a photographic jpeg image.

Figure 10

Figure10

Firstly click Save in the File Menu and a Save as JPEG Box appears as shown in Figure 11.

Figure 11

Figure11

Tick the box Show preview in the image window and the image appears in a new window as shown in Figure 12.

Figure 12

Figure12

At the top of the Save Box is a slider which can be grabbed and moved back and forth. As the slider moves you are able to see the file size change just below the slider and Figure 12 shows the reduction at a stage where the image has begun to pixellate at 9.5kB. Clearly this is unsatisfactory so the size is increased until the view of the image is at an acceptable level, Figure 13 where the size is a mere 13.8kB which is considerably less than the original.

Figure 13

Figure13

Now click Save and Figure 13 will be saved with a much reduced file size. This file size reduction has been explained in regard to that part of the image that was removed but it applies equally to any image.

It should be mentioned here that GIMP has it’s own native file extension which is .xcf and when used retains all the amendment facilities and layer information. However, when using images on the web it is better to use jpeg or png file extensions for images containing drawings (with transparency), photographs or images with some transparency. Therefore, it is recommended that you save the image twice, once as an .exf file and second as a .png file so that you can amend using the .exf file, if necessary, and post on the web or attach to an email using the .png file. The Gimp image cannot be saved directly as a .png file and when you try to do so a notice pops up telling you that. In that case click Export and the image will be saved as a .png file.

Layers

Now it is proposed to explain Layers and to show how you would arrive at the image shown in Figure 19 using five layers. If appropriate anything discussed above can be done to each layer.

Background Layer

Firstly, in the Image window select File, then New and a window appears giving you various options as to the size of the image, select a 640 by 600 pixel size image. Click OK. In the example illustrated, Figure 14, a full size Image Panel was used so a box outline (background layer) appears in the image window. If you use a reduced Image Panel window then the background layer may take up the whole of your image area.

Figure 14

Figure14

In this background layer it is proposed to introduce a colour gradient so go to the Toolbox panel and at the bottom you will see two partially overlying boxes. Click on the top foreground box and a foreground colour box appears where you select any colour you want. A green hue has been selected , now click OK. You will see that the selected colour is shown in the foreground box in the Toolbox Panel. Now click on the lower of the two boxes (the background box) and a background colour box appears. Again select a colour and click OK. What is now needed is to apply the colours to the image we are forming and this is done by clicking on the Blend Tool in the Toolbox then go to the image window click on its left side and drag a line across to the right hand side. Then release the mouse button and the image window or background layer fills with a colour gradient (see Figure 15) between your selected colours. Note that in the layer box the background layer is shown with the colour fill and with it’s name Background.

#>Note the line drawn could extend top to bottom or even diagonally and if you were to draw just a short line in the centre of the image the gradient will extend only over the length of the line. To the left of the line will be the foreground colour extending to the edge of the image, while to the right of the line the background colour extends to the right to the edge of the image.

Text Layer

This layer will be a text layer so click on the text icon in the Toolbox panel and then in the Text Options Box below the Toolbox choose your font and size of text. You will see from Figure 15 that 80 pixels was chosen as the size of my text. Now click in the image roughly where you want the text to appear and start typing. Should you decide you want to move the text simply click on the wording, hold the left mouse key down and drag the wording to where you want it. Let go the mouse button and that’s where the wording will be.

Figure 15

Figure15

The wording is coloured green and is not distinctive enough from the background so the colour of the text needs changing to say black. With the text icon still selected go to the Text Options Box and more specifically click on the colour bar just above the Justify icons. A text colour chart will appear from which black is selected. Click OK and the text immediately changes to black Figure 16.

Figure 16

Figure16

You will note that another layer appears in the Layer Panel above the Background layer. This new layer has a capitol T in it indicating it is the Text Layer.

Text Border Layer

Now to add a white border, for example, to the letters of the word SoSLUG a new layer will be required so click on the text layer in the Layer Panel and then go to the bottom of the Layer Panel where you will find a number of icons, the first three in my case are the Create New Layer and up and down arrows for moving the position of a selected layer.

So select the Text layer (the one with a capitol T in it) and then select Create a New Layer. In the panel that appears give the layer a name, say Text Border, and click OK. Using the down arrow move this new layer to lie beneath the Text layer. Now right click on the text layer and select Alpha to Selection from the menu that appears. This will provide a moving broken line around each of the letters. Click on Select in the Image window and choose Grow. In the panel that appears amend to grow by 2 pixels then click OK . You will note a small space now exists between the letters and the moving broken line.

Now select the Text Border layer so that it is active and select the Bucket tool from the Toolbox Panel. Make sure the foreground colour is white and then click inside the image (on the letters of the word SoSLUG) whereupon a white border will appear around the letters, that is because the black letters of the Text layer sit over the white letters of the Text Border layer. Now go to select in the Image Panel and click None and the resultant image appears, see Figure 17.

Figure 17

Figure17

Drop Shadow Layer

It is suggested now to add a drop shadow to the Text Border layer so select the Text Border layer in the Layer Panel, then Filters from the Image Panel followed by Light and Shadow/Drop Shadow from the respective sub-menus that appear. A Select-Fu: Drop Shadow panel appears in which you unclick Allow Resizing and then click OK, whereupon a shadow appears about the individual letters of SoSLUG, see Figure 18. You will see a new Drop Shadow layer has been produced in the Layer Panel.

Figure 18

Figure18

Border Layer

To add a border to the Image go to the Layer Panel and select Create a New Layer. In the New Layer Panel that appears name the layer Border and click OK. Select the Border Layer from the Layer Panel and then the Bucket Fill tool from the Toolbox Panel. Make sure the foreground colour is black, or any colour you wish, and click on the image which will turn completely black.

Now click Select in the Image Panel and click on All. Again click Select and then Shrink. In the Shrink Panel that appears shrink to 25 pixels and click OK. In the blackened image a broken line appears spaced 25 pixels from the outer edge. Select Delete on your keyboard and the black colour inside the 25 pixel border disappears to leave the image SoSLUG showing through the 25 pixel border. Again click Select then None and you will get your final image as shown in Figure 19.

Figure 19

Figure19

Summary

It is hoped that the above has given some indication as to how Gimp operates but of course there is no substitute for trying these things yourself and it is highly recommended you do that using all the above as a guide only. The number of combinations that can be used are infinite but please do remember that when you wish to work on a particular layer you need to select it to render it active.

Author: Peter Horwood - Page reference: 1068
Last modified: Peter Horwood - 2015-06-18