USING PAINT AND GIMP TO WORK WITH IMAGES. PAINT (Start: All Programs: Accessories: Paint) is a very simple application bundled with Windows XP. It has few facilities, but is still usable for one or two things. There is a much more sophisticated version called PAINT.net, which I am trying to get installed on these machines. GIMP is a general-purpose image manipulation package that runs on a wide variety of computers. GIMP stands for GNU Image Manipulation Program (and Gnu stands for GNU is Not Unix: for further details see http://www.gnu.org/home.shtml). GIMP is perhaps not the easiest piece of software to learn: there are simpler tools for generating digital images. PAINT The simplest tool is Paint If you have never really used this program, it might be an idea to try it first. (Even if you have, it s probably useful to use it again just to refresh your memory and this will take about 5 minutes if you are used to Paint.) The Toolbox in paint Paint allows the user to Select areas of the image (and these may be rectangular or free-form areas) To draw or erase on the image 1
To draw particular shapes And to choose a colour, and then fill that area/shape/drawn line with colour. The Text tool can be used (for example) to annotate images. Here s some suggestions as to what you might do. Open a photograph using File: open. (If you have no photographs in your filestore, you can get some from WEBCT. Look in the DGM901 WEBCT under either resources or materials: GIMP. Using the Web pages in there, right-click on a link, and save it somewhere in your filestore). Now add some annotation to this image. Try drawing a rectangle with PAINT. Note that when you select a rectangle (or other shape for drawing), a submenu opens below the toolbox. The top one selects drawing the edges only, the middle one selects drawing a fillable rectangle (with the outer edges), and the bottom one draws a filled shape. You can change the colour of these using the colour from the bottom palette, or if you would like to be marginally more adventurous, using the Colors: Edit Colors panel (to get the full selection colours use the Define Custom Colors Button). You can draw straight lines by selecting an appropriate pen, and dragging the mouse. Holding down shift at the same time makes the line drawn be either vertical, horizontal, or at 45 degrees. Try to create a professional looking drawing. Once you start adding a number of different entities, it starts to get difficult: in general, Paint is not really sufficiently sophisticated for many purposes (but nonetheless, it can be useful for doing something quickly, and it is very straightforward, as well as free. But it lacks important facilities, like cropping an image to a particular size. 2
DGM901 COMPUTING SCIENCE: DIGITAL MEDIA GIMP GIMP is a much more sophisticated piece of software altogether: unfortunately, with this sophistication comes a rather steeper learning curve! The other main competitor is Photoshop (indeed Photoshop is in many ways the industry standard there s even the verb to photoshop, meaning to adjust an image using software). Photoshop is just as hard to use! However, unlike Photoshop, GIMP is a free download, and is available for both Wintel PCs and Mac operating systems (and Linux too, I believe), see http://www.gimp.org/. The toolbox. GIMP s main toolbox contains a large variety of tools. The image below provides the title of most of them (the titles can also be seen by placing the mouse over the relevant icon). GIMP may be used for many purposes, from annotating a photograph to generating sophisticated artwork. This sheet is purely an introduction. 3
GIMP on-line tutorials In fact, the developers of GIMP provide some useful tutorials, and it is probably best to start with one of theirs. Note that often the precise look is different, as many were written for earlier versions of GIMP, or are illustrated on different machines and/or operating systems from the one you are using.). On WebCT, follow the link to the main GIMP manual (or just go to the URL: http://docs.gimp.org/en/), then look at Part 1 section 3 part 4 (GIMPLite Quickies). To load an image use File: Open. (Look back at the Paint section, earlier, for information on where to get a few photographs from WEBCT.) Read Section 4.1, then try out examples 4.2, 4.3, 4.4 and 4.5. (Note: I have made copies of the images required locally, and these can be downloaded from WebCT, as above). You should probably omit 4.6, but 4.7 is quite straightforward and useful. 4.8 is also useful (I didn t download this image: try it on any of the ones you already have. Section 5.1 and 5.2 look at drawing a straight line. I have made a slightly more detailed version available on WebCT, and you should try this. GIMP and photographs As well as adjusting the size of images, and allowing drawing in a sophisticated way, GIMP can also process photographs, in ways similar to that permitted by standard consumer tools such as Picasa and iphoto. Open a photograph in GIMP. Now look at the options under Colors. These allow you to adjust the colors and brightness etc. in the image in an almost infinite number of ways. Experiment with them. In particular, adjust the color balance to give various casts of color. You can colorize the image to make it look as though it has been snowing (very low value of hue, low value of saturation and lightness). Try thresholding the image: this replaces each colored pixel by one which is either black or white (that is, one bit/pixel). Change the value of the threshold (move the black arrow) and see what effect this has. Try posterizeing the image: this reduces the number of colours (so-called because standard poster production techniques can only use a limited number of inks). GIMP and layers One of the problems with PAINT is that every part of the image (the photograph, and all the annotations) are all put together: once you draw over part of the photo, you have lost that part of the photo, and you cannot get it back again. Most sophisticated drawing and image processing programs incorporate the idea of layering: that is, the image is actually made up of a set of layers, and one is looking through all these layers. Thus, one might have a photograph in one layer, and the annotation for the photo in a number of other layers. In this way, the original photograph is still all present in the composite image, and one can alter the annotation without leaving behind a trail of damage to the original photo. Eventually, one needs to flatten the image, and turn it into a single layer for saving as an image, or for printing, but one can keep the original layered image for later use (and alteration if required). Try this: Open a photograph with GIMP. Add a new layer to the image. (Layer: New Layer, and choose Transparency). Let s draw a filled box in this layer. 4
Choose the rectangle select tool, and draw a rectangle. It appears with a border, and some squares around it, which can be useful for resizing the rectangle. Fill the rectangle with a colour. You can choose the bucket fill tool, and this will fill the rectangle with the foreground or background colour, or with a pattern. But what if you want a different colour? We ll come back to that in a minute. On the Layers, Channels, Paths panel, the Layers display should look like this The box should be on top of some of the photo. If you click on the eye symbol, the layer will become invisible: click again where it was to make it re-appear. You can change the order of the layers by dragging and dropping. You can also adjust the degree of transparency of the selected layer (the one highlighted in blues) with the opacity slider. This can be used to allow one to look through some of the annotation at the picture below. GIMP and colours GIMP provides a useful way of choosing colours. To alter the foreground colour, double-click on the foreground colour in the toolbox. This should bring up a Change Foreground Color panel, like below. It s worth playing with this for a minute or two as it will help to illustrate how picture elements (pixels) are held in a digital image. There are two main systems for representing colour of a pixel: Hue/Saturation/Value (HSV) and Red/Green/Blue (RGB). In the figure above, the H (hue) box is checked. As a result, the square on the right shows all the colours displayable with the current value of the hue: Saturation varies from top to bottom, and Value from left to right. All the possible hues are displayed in a vertical bar to the right of the square. If you move the cross-hairs in the square, the varying values of saturation and value, and of Red, Green, and Blue are all displayed on the right. These are shown both in colour, and as a number. Hue can go from 0 to 360, Saturation and Value from 0 to 100, 5
and Red, green, and Blue from 0 to 255. You can equally update the numbers instead of moving the cross-hairs. In this way, all possible colours that can be displayed are shown (using two different representations). Notice that the foreground colour will alter as you alter the colours in this display. You can change the background colour in exactly the same way. Now try altering the colour of the box you drew. Try drawing a number of boxes in different layers, and adjusting their transparencies. You can merge layers together using the Layer: merge down menu item. GIMP and text You can annotate the box: choose the Text tool, and choose a large font size. First check that the colour you are using is not the same as the fill of the box (otherwise you will not be able to see the text), then type in some text. Note that GIMP automatically assigns a new layer, on top of the old ones. The text defaults to the foreground colour. Try annotating the box with some text that is in a contrasting colour to the box. There are a great many more facilities in GIMP than are discussed here! 6