C/IL 102 Lab Fall 2007
Digital Editing using GIMP
Digital Editing using GIMP
GIMP (GNU Image Manipulation Program) is a program similar to Photoshop or PaintShop PRO (except that it’s free). The two primary uses that we will study in this lab will be to create logos and to modify existing digital photographs. If you would like to have GIMP on your own computer you may go to http://www.gimp.org where you can download an appropriate version for your computer – Windows (NT, 2000 XP and Vista), Mac OS X, or Unix (including Linux). The images in this lab are from a macintosh version of GIMP but are very similar to the Windows version that you will be using in the lab. The GIMP has a very different interface from typical applications such as Word or Excel. It uses several windows rather than only one. This will probably take some getting used to, but many people prefer applications that work this way especially on a screen with higher resolution (such as 1024x768 or 1280x1024). In my opinion, this method is much easier to use on a system with multiple monitors. When you first start the GIMP you should have a desktop that looks something like the following:
Each of the Windows has a specific function and they can be resized or moved around separately so that for example you may create a setup that looks like the following:
If you double-click on one of the toolbox icons, its tool options window will appear. As you change from one tool to another the tool option changes appropriately.
The GIMP Website has a great deal of help in learning the intricacies of the program. There are several books, some available to be read online, and several tutorials. If you wish to become proficient with this program I recommend that you examine these sources.
You will first manipulate two photographs. There is a photograph of a giraffe, named Geoffrey. This file is 29 megabytes in size and if you were to place it on a Web site it would probably take more than 5 minutes to load. There is also a picture of a kitten, Buster. Buster.jpg is only 384 kilobytes in size and should take 10 or 20 seconds to load depending on network traffic.
1. Download both photos to the desktop.
a. Open a Web browser to Dr. Sidbury’s Web site http://www.cs.uofs.edu/~sidbury and click Lab Info under C/IL 102.
b. Scroll down to Lab 13 and right click on the two llinks Geoffrey and Buster. Choose the option to download them to your desktop.
2. Open the GIMP by clicking start and then Desktop Publishing and then choosing GIMP. If the program comes up with a full screen menu whose title bar says “The GIMP” then grab the title bar and move it slightly to the left to bring the right edge of the window on the screen. Then resize the window so that there are about 6 icons across on the toolbar. If the Layers, Channels, Paths window is not open or if the Brushes, Patterns, Gradients is not open then open them as follows: click file >Dialogs>Create New Dock and then open which ever one is missing. Open both if both are missing. In the pictures associated with this document they are both open and combined into one window.
3. Click on the file menu, choose OPEN, and select Giraffe.png from the desktop.
4. Your desktop should look something like the following:
The title bar of the picture should say something like Geoffrey.png-3.0 (RGB, 1 layer) 3024x1998. The file name containing the picture is Geoffrey.png. The picture is a single layer. If we could separate the picture into several layers, such as one for the background, and another for the giraffe. By doing this you can modify each layer individually and then combine them back together or replace one with something else, so for example you could place the giraffe in the desert. The size of the picture is 3024 pixels wide by 1998 pixels high.
NOTE: By pointing to a picture and pressing control-D you will create a duplicate of the picture which you can manipulate thus preserving the original. You should probably do this to all the exercises using photographs.
5. Change the dimensions of this picture as follows:
a. In the menu above the picture click on Image and then select Scale Image. This should open a new window with Image Size listed as 3024 wide and 1998 high in pixels. Beside the dimensions is a chain with two links connected. If you click on the chain the links will be disconnected. If you click again they will reconnect. If the links are connected, changing one dimension automatically changes the other proportionately. This preserves the aspect ratio of the picture. (The aspect ratio is the ratio of the width to the height.) If the aspect ratio is NOT preserved then the picture will be distorted, so that for example if you increased the height proportionately more than the width then the giraffe would become taller (and skinnier). Normally you will want to preserve the aspect ratio so the link should be connected.
b. Let’s cut ths size to 500 wide. Highlight the 3024 and type 500. The height should change to 330 automatically after a few seconds. The units are pixels but can be changed to inches, millimeters, percent and other choices. Now click the arrow beside interpolation and change the choice from linear to Cubic. This choice determines the quality of the finished picture. Cubic gives higher quality but takes longer to do.
c. Finally click scale. This should change the scale of the picture (and simultaneously reduce its size). If you now click Edit the first choice in the Edit menu is Undo Scale Image. Thus if you make a mistake you can undo it and start over. This feature is available for almost all GIMP manipulations and when combined with working on the duplicate of a picture ensures that the original will be preserved. If you clicked the UNDO then go back to step b and redo the Scale Image.
d. Show the results to your instructor.
This should change the size to 500 x 330. Click file > save as > and name it Giraffe1.png and save. Right click the picture’s icon and you will see it’s size is now only about 336K a reduction in size of more than 98 percent.
6. Now undo all the changes that you’ve made.
a. Selet>Undo Scale Image. You should now be back where you were before
7. Now change the type of file that you have.
a. click File and then select save as
b. now type the name Giraffe.jpg (to change the type of file from png to jpeg) and click save.
c. This should bring up another window, Save as JPEG. The quality slider should be somewhere near 85. Click OK and this will save the picture on the desktop. It’s now 1.5 megabytes (and still 3024x1998 pixels), a reduction of approximately 95 percent.
d. You can save the image in another format such as GIF, TIFF, PSD, PNG, JPG and several others. The advantages of various formats are discussed in Tao of Computing chapter 2.
8. Crop the image – i.e. choose part of the picture.
a. Bring the tool bar to the front and select the crop tool (it looks sort of like a knife. When you move your cursor over the picture it will change into a plus. Now move the cursor above and to the left of the giraffe and press and hold the left mouse button. Drag the button to the right and down until you have covered Then release the mouse button. Click crop on the crop window. If you click edit you can undo the crop and start over.
b. Show the cropped result to your instructor.
9. Play time. Many times you will take a photograph that is technically unsatisfactory – the color balance is wrong, the contrast is wrong, the brightness is wrong, the saturation is wrong … you get the idea. We will now use several techniques to “improve” our pictures.
a. Open the picture of Buster that you saved on your desktop, and make a duplicate of it. You will “play” with the duplicate.
b. Click layer>colors>auto and you should see a result similar to the above picture. Choose each of the above and look at the result and then UNDO it. Equalize will probably give very weird results which may look spectacular with some pictures but strange with most pictures. The others make subtle adjustments.
c. A more sophisticated way of manipulation can be done by clicking Tools > Color Tools > Levels. This will bring up the levels window:
This window has several ways of modifying the picture. First click the AUTO button and the picture will be automatically enhanced. Click the RESET button below to undo this change. If the Preview checkbox is checked then changes that you make will be shown on your copy.
Beside the auto button are three eye-droppers, the first for black the second for grey and the third for white. Click the black eyedropper and then point to a part of the picture that should be black and click. (I chose a spot in Buster’s eye.) By choosing other points interesting results can be obtained: try to use black with a spot on the wooden floor to see what I mean. Redo this with the white as well. A very good color adjustment can be done by doing a black balance followed by a white balance. Note that after you finish doing the last dropper change you should click the dropper to turn it off.
d. There are two sliders, one just below the graph with three triangles just below the slider and below it a black dropper a white dropper and three number windows. You can move the sliders by changing the numbers or picking a black and white reference point or by just grabbing them and moving them. If you click the Reset channel above this sets the values back to their original values. You can also change the channel value to Red or Green or Blue and make changes to them for “artistic” results. Set the channel to Red and move the middle triangle to the left about half way (2.94 is the value I found) and look at the result. Now move it to the right about half way to the end (.34 is approximately where I went). Then reset the channel. Make changes to several channels together and observe the results.
e. If the exposure had a low shutter speed there is a possibility that the picture is blurred. In general if the picture is too blurred there is nothing you can do. However if the blur is slight you might be able to sharpen the picture slightly. This technique should be uses sparingly. Click filters > Enhance > Unsharp Mask. (I know, unsharp sounds backwards but this is the best tool for sharpening the picture). Set the amount to 1, the radius to 1 and the threshold to 0 and click OK. Reset it and redo the problem with the amount set to 5. The picture is now sharper but very unrealistic.
f. If the picture is too sharp you can blur iit by simply choosing filters > blur > blur. And repeat as often as necessary.
g. How to make a greyscale version of a picture
i. Easy way. Right click the picture of Buster, choose image, choose mode, select grayscale.
ii. Hard Way. Right click the picture, choose Image, choose mode, choose decompose. Choose RGB and make sure that decompose to layers is checked. Click OK.
iii. This should open a new window named red-4.0 (grayscale, 3 layers) and it’s gray. If you look at the layers, channels, paths… window it should have red-4 (or whatever) listed at the top.and there should be three pictures below it labeled blue, green, red with eyes on the left: at the moment each of the layers is visible. If you click on one of the eyes that particular layer will be hidden from view. Click on each of them and you should see a gray and white checkerboard. Now click on the (invisible) eye beside the red picture and you see just the red layer. Close that eye and look at each of the other layers. Often the Green layer is a very good grayscale image.
iv. Redo this problem except choose HSV as the decomposition and look at the value layer. It also produces a good grayscale. You might also look at the other two layers to see what they produce. Other decompositions produce interesting grayscale pictures.
v. Sepia tone gives an old time look to a picture. It is a long complicated process that can be automated via a script. Choose a picture of Buster and select Script-fu > décor > old photo. This brings up a window: Script-Fu: Old Photo. Make sure that Sepia and Work on Copy are both checked. Defocus and also be selected if you wish. Set border size to 30 and click OK.
vi. Show the results to your instructor.