Graphics Creation – Editing Bitmap Images (Cambridge AS/A‑Level IT 9626)
Learning Objectives
By the end of this lesson you will be able to:
- Select specific areas of a bitmap image using the appropriate selection tools, masks and layers.
- Apply correction techniques – colour balance, levels, contrast, brightness and retouching – both globally and locally.
- Resize bitmap images while preserving visual quality and understand the effect on resolution, file size and colour‑space.
- Contrast bitmap and vector graphics, and outline the basics of frame‑by‑frame animation.
- Choose the most suitable file format, explain compression and colour‑profile issues, and recognise ethical considerations when using graphics.
1. Bitmap Fundamentals
A bitmap (raster) image is a rectangular grid of pixels, each pixel storing colour information.
- Resolution – measured in pixels per inch (ppi) or dots per inch (dpi). Higher resolution = more detail.
- Colour depth – bits per pixel (bpp). Common depths: 8‑bit (256 colours), 24‑bit (true colour), 32‑bit (true colour + alpha channel).
- Colour models
- RGB – additive model for screen display.
- CMYK – subtractive model for printing; conversion can shift colours.
- HSL / HSV – hue, saturation, lightness/value; useful for selective colour adjustments.
- CIELAB – perceptual model; often used when colour‑balance must be device‑independent.
Worked Example – Uncompressed file size
For a 1920 × 1080 pixel image at 24‑bit colour depth:
Size (bytes) = width × height × (bits per pixel ÷ 8)
= 1920 × 1080 × (24 ÷ 8)
= 1920 × 1080 × 3
= 6 220 800 bytes ≈ 5.93 MB
2. Quick‑Reference Cheat‑Sheet (Exam Command‑Words)
| Command‑word | Tool / Feature | Typical Action |
| Select | Marquee, Lasso, Polygonal Lasso, Magic Wand, Quick Selection Brush | Define a region for a subsequent edit. |
| Mask | Layer Mask, Vector Mask | Create a non‑destructive hide/show map (white = visible, black = hidden). |
| Layer | New Layer, Adjustment Layer, Group | Separate elements so changes can be isolated or blended. |
| Adjust | Adjustment Layer (Colour Balance, Levels, Brightness/Contrast) | Apply colour or tonal changes without altering original pixels. |
| Resize | Image Size / Scale Image dialog | Change pixel dimensions using an interpolation method. |
| Export | Save for Web, Export As | Write the final image to the required format and compression. |
3. Selection Tools, Masks & Layers
3.1 Selection Tools
| Tool | Best Use | Strengths / Limitations |
| Marquee (Rectangular / Elliptical) | Geometric shapes | Very fast; cannot handle irregular edges. |
| Lasso (Freehand) | Hand‑drawn outlines | Precise control; hand‑shakiness can cause jagged edges. |
| Polygonal Lasso | Objects with straight edges | Accurate for angular shapes; requires clicking each corner. |
| Magic Wand / Colour Range | Uniform colour areas | Quick selection; tolerance must be set correctly. |
| Quick Selection Brush | Complex subjects (people, foliage) | Algorithm expands selection; often needs refinement. |
3.2 Masks
- A mask stores the selection as a greyscale channel (white = visible, black = hidden, greys = partial transparency).
- Masks are **non‑destructive** – you can edit the mask at any time without altering pixel data.
- Typical workflow: Select → Add Layer Mask → Refine (Feather, Refine Edge) → Paint on mask with black/white.
3.3 Layers & Adjustment Layers
- Layers stack independent image elements; they can be reordered, hidden, or blended.
- Adjustment layers (Colour Balance, Levels, Curves, Brightness/Contrast) apply changes only to the layers beneath them, preserving the original data.
- Group related layers to keep the workspace tidy and to apply a collective mask or blending mode.
Common error: Applying the Clone Stamp directly on an adjustment layer can cause unexpected colour shifts – rasterise the adjustment layer first if you need to clone.
4. Correction Techniques
4.1 Colour Balance & Levels
- Colour Balance shifts the contribution of each RGB channel in Shadows, Mid‑tones and Highlights.
- Levels stretch or compress the histogram. Use the three sliders:
- Shadows – left‑most slider.
- Mid‑tones – centre slider.
- Highlights – right‑most slider.
Linear stretch formula (input range a–b to output 0–255):
output = ((pixel – a) / (b – a)) × 255
4.2 Contrast & Brightness
Contrast expands the distance between light and dark values; brightness adds a constant offset.
newPixel = α × pixel + β
- α (alpha) – contrast factor (α > 1 = higher contrast).
- β (beta) – brightness offset (positive = lighter).
4.3 Retouching (Healing & Clone Stamp)
- Healing Brush – samples texture from a source area and blends it to match surrounding tones automatically.
- Clone Stamp – copies pixels exactly; useful for precise duplication but may need manual blending.
4.4 Exam‑Style Task
Task: Using the supplied photograph, increase the contrast of the sky by +30, brighten the foreground by +15, and remove a stray telephone pole using the Healing Brush. Save the final image as a JPEG with 80 % quality.
- Make a Lasso selection around the sky.
- Create an Adjustment Layer → Brightness/Contrast and set Contrast = +30.
- Make a Rectangular Marquee selection of the foreground, add another Adjustment Layer → Brightness/Contrast with Brightness = +15.
- Choose the Healing Brush, Alt‑click a clean area of the ground, then paint over the telephone pole.
- Toggle the adjustment‑layer masks off to review the whole image.
- Export →
Save for Web (JPEG, Quality = 80 %).
5. Resizing Bitmap Images
5.1 Interpolation Methods
| Method | How it works | Best Use |
| Nearest‑Neighbour | Copies the colour of the nearest pixel. | Pixel art, icons that require hard edges. |
| Bilinear | Weighted average of the four nearest pixels. | Moderate scaling where speed is a priority. |
| Bicubic | Weighted average of sixteen surrounding pixels. | Photographic images; highest quality for up‑ or down‑scaling. |
5.2 File‑Size Impact of Interpolation
| Interpolation | Typical File‑size Change (24‑bit) | Visual Result |
| Nearest‑Neighbour (up‑scale 200 %) | ≈ 4 × original (pixel count quadruples) | Sharp edges, noticeable pixelation. |
| Bilinear (up‑scale 200 %) | ≈ 4 × original | Smoother but slightly blurry. |
| Bicubic (up‑scale 200 %) | ≈ 4 × original | Sharp with minimal artefacts; best for photographs. |
5.3 Calculating New Dimensions
If an image of width W and height H is resized by a scale factor s:
W' = s × W H' = s × H
5.4 Worked Example – Upscaling with Bicubic
- Original size: 1200 × 800 px.
- Desired scale: 150 % (s = 1.5).
- New size: W' = 1.5 × 1200 = 1800 px, H' = 1.5 × 800 = 1200 px.
- Choose Bicubic interpolation.
- Uncompressed size (24‑bit): 1800 × 1200 × 3 = 6 480 000 bytes ≈ 6.18 MB.
Common error: Disabling “Constrain Proportions” leads to stretched or squashed images.
6. Vector Graphics – A Quick Contrast
- Definition: Images are described by mathematical paths (lines, curves, shapes) rather than a fixed pixel grid.
- Key tools: Pen tool, Shape tools, Bézier curve handles, Pathfinder operations.
- Advantages:
- Unlimited scaling without quality loss.
- Typically smaller file sizes for simple graphics (logos, icons, diagrams).
- Easy colour‑profile changes – vectors are device‑independent.
- When to use vectors: Logos, icons, UI elements, technical diagrams, any graphic that must be resized frequently or printed at many sizes.
- Common vector formats: SVG (web), EPS (print), PDF (mixed).
7. Simple Animation Basics
- Frame‑by‑frame animation – each frame is a separate bitmap layer; the timeline plays them in sequence.
- Export options
- Animated GIF – up to 256 colours, suitable for short web loops.
- MP4 / WebM – video codecs, full colour, longer duration.
- Key‑frame concept – define the start and end states; the editor interpolates intermediate frames (available in advanced raster editors).
8. File Formats, Compression & Colour‑Profile Considerations
| Format | Compression | Typical Use | Colour‑space / Metadata |
| JPEG | Lossy (quantisation) | Web photographs, email | RGB; embeds EXIF & ICC profile. |
| PNG | Lossless (deflate) | Web graphics, screenshots, transparency | RGB or indexed; supports gamma & ICC profiles. |
| GIF | Lossless (LZW) but limited to 256 colours | Simple animations, icons | Indexed only; no colour‑profile support. |
| SVG | Vector (XML‑based) | Scalable icons, diagrams, UI assets | Device‑independent; styling via CSS. |
| TIFF | Lossless (LZW, ZIP) or lossy (JPEG‑TIFF) | Print production, archival storage | Supports CMYK, ICC profiles, multiple layers. |
Compression & Quality Tip
When saving a JPEG, a quality setting of **80 %** usually offers a good balance between file size and visible artefacts. Always preview at 100 % zoom before finalising.
9. Responsible Use of Graphics
- Verify that you have the legal right to use an image (copyright, licence, Creative Commons).
- Provide appropriate attribution where required.
- Avoid misleading edits – e.g., altering a portrait in a way that could be defamatory.
- Consider accessibility: add concise
alt‑text for web images.
10. Practical Workflow (Step‑by‑Step)
- Open & duplicate:
File → Open, then duplicate the background layer (Ctrl + J).
- Select the area: Choose the most suitable selection tool; refine with Feather (1–5 px) or Refine Edge.
- Mask (optional): Click “Add layer mask” to keep the edit non‑destructive.
- Apply corrections:
- Adjustment layer → Colour Balance / Levels.
- Adjustment layer → Brightness/Contrast.
- Healing Brush or Clone Stamp on the masked region.
- Review: Toggle mask visibility or press Ctrl + D to deselect and see the whole image.
- Resize:
-
Image → Image Size (or Scale Image).
- Enter new dimensions or a percentage; ensure “Constrain Proportions” is checked.
- Select an interpolation method (Bicubic for photos, Nearest‑Neighbour for pixel art).
- Confirm.
- Save & export:
- For web:
File → Export → Save for Web (PNG‑24 or JPEG 80 %).
- For print:
File → Save As → TIFF (CMYK, embed ICC profile).
- Keep a master copy in the native format (PSD / XCF) with all layers intact.
11. Common Pitfalls & How to Avoid Them
- Distorting aspect ratio: Always lock the width‑height ratio when scaling.
- Quality loss on up‑scaling: Use Bicubic interpolation; if the image is a logo, recreate it as a vector.
- Hard edges after selection: Feather the selection or apply a slight Gaussian blur to the mask.
- Colour banding after heavy contrast changes: Work in 16‑bit mode or add a subtle noise layer.
- Saving JPEG at too low quality: Preview at 100 % zoom; increase quality if banding or blockiness appears.
- Forgetting colour‑profile conversion: Convert RGB → CMYK before sending to a printer to avoid unexpected colour shifts.
12. Self‑Assessment Questions
- Explain the difference between a selection and a mask. When would you choose one over the other?
- Calculate the uncompressed file size of a 3000 × 2000 pixel image saved at 32‑bit colour depth.
- Given an image that must be reduced from 2500 × 1800 px to 1250 × 900 px, which interpolation method would you select and why?
- List three situations where a vector format (e.g., SVG) is preferable to a bitmap format.
- Describe the steps required to create a 5‑frame animated GIF from a single photograph where the subject moves across the frame.