@tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ (...

25
1 Image Processing with GIMP Name: _____________________________ Class: ______________________ ( ) Contents 1. Image Processing Basics...................................2 1.1. Raster Graphics and Vector Graphics..................2 1.2. Raster Image Formats.................................2 1.3. Basic Properties of Raster Images....................3 1.4. Common Features of Image Editing Software............5 2. Introduction to GIMP......................................6 2.1. Introduction.........................................6 2.2. GIMP Interface.......................................6 2.3. Single window mode...................................7 2.4. Setting the language.................................7 3. GIMP Toolbox..............................................8 4. Basic Skills.............................................10 4.1. Adjusting the colours...............................10 4.2. Compositing.........................................11 4.3. Layers and Layer groups.............................12 4.4. Texts............................................... 13 4.5. Simple effects......................................14

Transcript of @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ (...

Page 1: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

Image Processing with GIMP

Name: _____________________________ Class: ______________________ ( )

Contents

1. Image Processing Basics.......................................................................................................2

1.1. Raster Graphics and Vector Graphics......................................................................2

1.2. Raster Image Formats................................................................................................2

1.3. Basic Properties of Raster Images............................................................................3

1.4. Common Features of Image Editing Software.........................................................5

2. Introduction to GIMP............................................................................................................6

2.1. Introduction................................................................................................................6

2.2. GIMP Interface............................................................................................................6

2.3. Single window mode..................................................................................................7

2.4. Setting the language..................................................................................................7

3. GIMP Toolbox........................................................................................................................8

4. Basic Skills............................................................................................................................10

4.1. Adjusting the colours...............................................................................................10

4.2. Compositing..............................................................................................................11

4.3. Layers and Layer groups..........................................................................................12

4.4. Texts...........................................................................................................................13

4.5. Simple effects............................................................................................................14

Index of photos (and credits).....................................................................................................15

Summary of All Chapters............................................................................................................16

1

Page 2: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

2

Page 3: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

1. Image Processing Basics

1.1. Raster Graphics and Vector Graphics

There are two main kinds of graphics: raster graphics and vector graphics.

Raster (or bitmap) graphics is to represent graphics into small rectangular points called pixels. (See Figure 1) Raster graphics is suitable to store digital photos.

In contrast, vector graphics is to represent graphics into geometric objects like lines, curves, polygon, etc. These objects can be enlarged without any loss of quality. (See Figure 2), and is therefore useful in visual designs.

1.2. Raster Image Formats

1.2.1. Common raster formats

Common raster image formats are listed below:

Extension Name PropertiesBMP Windows Bitmap Accepted in most image processing

programs.JPG (or JPEG)

Joint Photographic Expert Group

Saves storage space using lossy compression. Most commonly used with digital photos.

GIF Graphics Interchange Format

Can only store image in 256 colours. Renowned for its ability to store animations.

PNG Portable Network Graphics Provides better lossless compression than BMP and GIF.

TIF (or TIFF)

Tagged Image File Format Store one or multiple images in the same file. Have an extensive set of options (which are outside the scope of this book).

RAW, CR2, etc…

Raw image formats1. (They are referred as RAW despite having other file

A good digital camera can store files in raw image formats, having minimal processing. They can be processed later with the highest

1 GIMP cannot open RAW images by itself. However, you may use a plugin called UFRaw into GIMP to open RAW images.

3

Figure 1 Raster Graphicss Figure 2 Comparison of vector graphics and raster graphics

Page 4: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

extensions.) quality.1.2.2. Raster image formats used by image editing software

Image processing software can store extra information, such as text and layers, in its own file format. If you save the image in these formats, you can open your image later and continue processing.

Extension SoftwareXCF GIMPPSD Adobe PhotoShopUFO PhotoImpact (Corel / Ulead)PNG Fireworks (Adobe / Marcomedia)

It is possible to open these files with other programs. However, the image may have subtle differences if other programs are used.

1.3. Basic Properties of Raster Images

1.3.1. Dimensions

The dimensions of images can be described in its width and height. For example, an 800 × 600 image means it has a width of 800 pixels, and a height of 600 pixels.

To convert the number of pixels into physical units, the dots per inch (DPI) can be specified for individual images.

The ratio of the width and the height is called the aspect ratio. For example a 800 × 600 photo has an aspect ratio of 4 : 3. If the aspect ratio of a photo is changed in enlargement or reduction, the image appears deformed and looks ugly.

1.3.2. Colours and Channels

In colour images, such as digital photos, the colour of each pixel is stored in three numbers. The most common combination is red, green and blue, which are the three additive primary colours. This is known as the RGB Colour Space.

In an image editing software, red, green and blue are referred as channels of the image. In addition

4

Figure 3 RGB Colour Space

Page 5: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

to the colour channels, the alpha channel is used to store the opacity of the pixels. (Opacity ranges from fully transparent to fully opaque.)

1.3.3. Colour depth

The colour depth, or bit depth, is the number of data bits2 used to represent a pixel. The colour depth of a digital photo is usually 24 bits, which is having 8 bits in each channel3. Some image formats, such as BMP and PNG, allow the use an additional 8 bits to store the alpha channel.4

Grayscale images, having only one channel, usually have a colour depth of 8 bit. Also, Black and white images have a colour depth of 1 bit.

1.3.4. Colour spaces

It is very difficult to select a colour in the RGB Colour Space. Therefore, GIMP also uses the HSV Colour Space to represent colours. H stands for hue, S stands for saturation and V stands for value.5

Hue ranges from 0 to 360 (degrees). 0° stands for red, 120° stands for green and 240° stands for blue.

High saturation means that the pixel is coloured, while pixels with zero saturation are black, grey or white pixels. Finally, high value means that the pixel is bright while low value means a dark colour.

Other common colour spaces includes HSL, CMYK, Lab and YCbCr. (Note: you are only required to understand RGB and HSV this year.)

2 A bit is the short form of a binary digit, which has a value of either 0 or 1.3 Having 8 bits means there are 28 = 256 different levels of each primary colour.4 The 32-bit pixel with transparency is called RGBA (Red, Green, Blue, Alpha).5 In Microsoft Windows, a slightly different HSL Colour Space is used, where L stands for lightness.

5

Page 6: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

1.3.5. Loseless and lossy compression

To save storage space, compression is used in most image formats, to reduce the actual amount of storage space needed for images. There are two major kinds of compression.

Loseless compression is a category of compression that the exact original data can be obtained in the process of decompression. GIF and PNG files employ loseless compression.

In contrast, lossy compression means that some of the original data is discarded during compression. In return, the file size of an image with lossy compression is much smaller than the same image with loseless compression. JPG files employ lossy compression.

Loseless compression is best for hand-drawn graphics, which have large areas of solid colours. Meanwhile, lossy compression is suitable for photos, because minor losses in details are not important to the overall quality of the picture.

1.4. Common Features of Image Editing Software

1.4.1. Layers

You can put different objects in into different layers in an image editing software, so you may move the objects and put them above or below other objects. For example, the picture at the right has a layer for the mailbox, a layer for the train and a layer for the background.

1.4.2. Text

In most image editing software, you may insert text into the image and do simple word processing.

The font used in the text is NOT stored in the image. Therefore, if you copy the files into another computer, the font used in the text must also be installed in that computer to make the text display correctly.

6

Page 7: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

2. Introduction to GIMP

2.1. Introduction

GIMP6 is a free image editing software. Unlike Adobe PhotoShop and PhotoImpact, you can download GIMP from the internet and install it in your computer legally without paying for the program.

The simplest way to install GIMP is download it from PortableApps.com. Its URL is http://portableapps.com/apps/graphics_pictures/gimp_portable. Alternatively, you can download the PortableApps.com platform from http://portableapps.com/download.

2.2. GIMP Interface

When you start GIMP7, you will see the following:

A window called “GNU Image Manipulation Program” which contains the menu bar.

The Toolbox. Put your mouse over a tool/icon to see its description. Below the tools there are the options for the selected tool.

The “Layers, Channel, Paths, Undo” window. These are the features that make GIMP and other image editing software more powerful than Paint.

6 GIMP is the acronym of “GNU Image Manipulation Program”. GNU is the reverse acronym “GNU’s not Unix”; and Unix is the name of an operating system.7 When you launch GIMP for the first time, you need to wait for several minutes for the program to initialize. Subsequent launches will be much faster.

7

Page 8: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

2.3. Single window mode

You can use the single window mode by the “Windows” “Single Window Mode” command. You are recommended to use the single window mode because it is more user-friendly.

2.4. Setting the language

You can select a language for the GIMP interface. In this book, the English (en_US) language is used.

Even though your mother tongue may not be English, you should use the English interface of GIMP because the Chinese interface is poorly translated.

8

Page 9: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

3. GIMP Toolbox

Here are the icons in the toolbox and their functions: (source: en.wikibooks.org/wiki/GIMP/Toolbox)

Icon Name Shortcut Description

Brush toolsBucket Fill Shift + B Fills an area with a colour or pattern.

Blend (Gradient) L Fills an area with a gradient.

Pencil N Paints hard-edged lines; that is, the pixels are not anti-aliased.

Paintbrush P Paints soft- or fuzzy-edged lines; that is, the pixels are anti-aliased and/or feathered.

Eraser Shift + E Erases pixels from a layer.

Airbrush A Paint tool with variable pressure.

Ink K Paints anti-aliased lines with a simulation of a nib.

Clone C Copies pixels from one part of an image to another.

Heal H Heals image irregularities.

Perspective Clone (none) Clone from an image source after applying perspective transformation.

Convolve (Blur/Sharpen) Shift + U Blurs or sharpens an image.

Smudge S Spreads pixels in the direction of a "push".

Dodge/Burn Shift + D Lightens or darkens an image's shadows, mid tones, or highlights.

Selection toolsRectangle R Selects square or rectangular regions.

Ellipse E Selects circular or elliptical regions.

Free (Lasso) F Draw free-form selections.Fuzzy (Magic Wand) U Select continuous regions of colour.

By Colour Shift + O Select all instances of a colour in an image.

Scissors I Create paths to select shapes.

9

Page 10: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

Foreground (none) Select a region containing foreground objects.

10

Page 11: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

Transform tools

Move M Moves layers and selections.

Align Q Align or arrange layers and/or other objects.

Crop Shift + C Crops or clips the image.

Rotate Shift + R Rotates the active layer, selection or path.

Scale Shift + T Scales the active layer, selection or path.

Shear Shift + S Shifts part of the image to some direction.

Perspective Shift + P Changes the perspective of the active layer, selection or path.

Flip Shift + F Flips layers and selections.

Cage Transform Shift + G Deform the selection with a cage.

Other tools

Path B Allows selecting and modifying paths.

Colour Picker O Selects the colour of any image opened on your screen.

Magnify (Zoom) Z Alters the zoom level of the image.

Measure Shift + M Shows distances and angles.

Text M Places text into your image.

11

Page 12: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

4. Basic Skills

In this chapter, we will do a few common image processing tasks in GIMP.

Lesson Preparation

Bring three favourite photos which show your full body. It is okay to have someone else in the same photo, but make sure that you are not blocked by something else in the photo.Hint: send yourself an e-mail with these photos.(The photos will be used in the homework.)

4.1. Adjusting the colours

Learning objective

To adjust the colours of the digital photos.

Instructions

1. Open “garden.jpg”.2. Use the filters below and experiment.

(Undo before trying the next filter, otherwise the effect will stack.)

Filter Suggested Settings ObservationsBrightness-Contrast

Brightness - 10, Contrast + 20

Color Balance Nil (explore freely)Levels Input levels: Black slider (From 0 to

50 )Try also adjusting individual channels

Curves Click a point on the line and drag freely

Desaturate Luminosity (this looks better)Invert -Value Invert -Auto Try all filters under this menu

12

Page 13: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

Colorize Hue: 30, Saturation: 30, Value: -3

3. Open the picture “underexposed.jpg” and “overexposed.jpg”, and try to correct the problems. (Note: some parts of one of the pictures cannot be recovered. Why?)

13

Page 14: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

4.2. Compositing

Learning objective

Use the “Scissors Select Tool” to separate an object from the background, and paste it in other photos.

Instructions

1. Open “principal.jpg” and “waterfall.jpg”.2. In “principal.jpg”, select the principal with the “Scissors Select Tool”.3. Copy the image of the principal, and paste it in an appropriate place in

“waterfall.jpg”4. Resize the principal to an appropriate size.5. Save the resulting image to an .xcf file, and also export to a .jpg file.

Homework: Adding yourself to a scenery photo

1. Open a scenery photo in GIMP. You may use your own scenery photo, or download one from the internet. Open another digital photo containing your image.

2. Paste yourself into to a suitable place a scenery photo.3. Export the final result as “completed.jpg”.4. Compress both source images (one for the scenery, another for yourself) and also

“completed.jpg” into a .zip file. (There should be a total of 3 images.)5. Upload the .zip file to eClass.

14

Page 15: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

4.3. Layers and Layer groups

Learning objective

Put parts of the image (e.g. those obtained by selection) to layers. Do simple operation on layers such as duplicate, resize, rotate, etc.

Instructions

1. Open “heart1.png”, “heart2.png” and “mothersday.png”.2. In either heart, select the heart with “Scissors Select Tool”.3. Copy the heart, and paste it into “mothersday.png”4. Resize the heart to an appropriate size.5. Make duplicate copies of the heart (or both hearts), and use them to form the border

of the image. (Do this creatively.)6. Rotate some (or all) hearts.7. Save the resulting image to an .xcf file, and also export to a .jpg/.png file.

15

Page 16: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

4.4. Texts

Learning objective

Type text in GIMP 2.8 and apply rich text formatting.

Instructions

1. Make a blank picture with size 1024 × 768.2. Fill with white colour if necessary.3. Use the text tool to type “RAINBOW” into the picture.4. Set the font to be Garamond, 144px. (Note: 1 px = 1 pixel = 0.75 pt)5. Change the colour as follows: “RAINBOW” (the colours of a rainbow).

Homework: Making a greeting card

1. Create a picture of size about 10” × 7”.2. (a) Add a picture and make fade out its colour, or

(b) Add a gradient background and add some cartoons.(You may search for pictures from the internet.)

3. Grab one (or more) symbol and use it to make the border of the card.(Again, you may search for pictures from the internet.)

4. Type a greeting message and apply a good font. Apply text formats liberally.5. Write down your name in the lower right corner of the picture.6. Save the picture as “[Name] (No).jpg”. (Replace by your name and class number.)7. Zip the completed card and ALL source files (pictures, cartoons, symbols) and submit

it to eClass.

16

Page 17: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

4.5. Simple effects

4.5.1. Drop shadow

Learning objective

Apply a drop shadow (to text and object).

Instructions

1. Open “xmascard.jpg”.2. Type your name into the picture. Set the font to Garamond 72pt.

(Break your name into two or more lines if needed.)3. Select the text layer. Then select “Filter” “Light and Shadow” “Drop Shadow”4. Enter 4, 4, 15, black, 60%, allow resizing (i.e. just the defaults).5. Create a layer group, and then move text and drop shadow into the group.6. Move the layer group. (Note: Press SHIFT to move the active layer.)7. Insert “heart3.png”. Add the same drop shadow.

4.5.2. Selective colour

Learning objective

Apply a colour filter in the selection.

Instructions

1. Open “photo.jpg”.2. Select the man in the front. (Use the “Scissors Select Tool”.)3. Adjust the selection if necessary. (Make sure the right bottom corner is selected.)4. Invert selection.5. Apply “Desaturate” command. (Shades of grey based on luminosity.)6. Apply “Levels” command to make the background lighter.

17

Page 18: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

Index of photos (and credits)

garden.jpgFrom TH Media Gallery

overexposed.jpgBy Dan Nguyen (CC BY-NC 2.0)

underexposed.jpgBy WC Leung

garden.jpgFrom TH Media Gallery

waterfall.jpgBy Roman Stanek (CC BY 2.0) -

heart1.pngBy Zee Que (CC BY 3.0)

heart2.pngBy Zee Que (CC BY 3.0)

mothersday.pngBy MissPowerPoint (CC BY-NC 3.0)

xmascard.jpgunknown source

bell.pngFrom www.icondrawer.com

photo.jpgFrom TH Media Gallery

18

Page 19: @tanghin.edu.hk/f2cp/13-14/gim… · Web viewImage Processing with GIMP. Name: _____ Class: _____ ( ) Contents. 1.Image Processing Basics2. 1.1.Raster Graphics and Vector Graphics2

Summary of All Chapters

19