Image Representation

intermediate30 min

Learning objectives

  • Explain how bitmap images are stored
  • Calculate image file sizes
  • Evaluate the effects of resolution and colour depth on image quality

Learn

AQA 4.5.5 — Image representation

Retrieval: the previous lesson represented text as a sequence of individually-coded characters. A bitmap image applies the same underlying idea — break the real-world thing into discrete units, then store a binary code for each — to a grid of coloured dots instead.

Key vocabulary

  • Pixel ("picture element") — the smallest single unit of a bitmap image; one dot of one colour.
  • Resolution — the width × height of the image, measured in pixels (e.g. 1920 × 1080).
  • Colour depth (or bit depth) — the number of bits used to store each pixel's colour; more bits means more distinguishable colours.
  • Metadata — extra information stored alongside the pixel data itself (e.g. resolution, colour depth, creation date) needed to correctly display the image.

Understand — an image is a grid of numbers

A bitmap image is stored as a grid of pixels, each with its own colour value. Nothing about the image is stored as shapes, lines or objects — it's purely a large table of individual colour codes, one per pixel position.

See it — a tiny 4×4 monochrome image

A 4×4 pixel black-and-white image, where each pixel needs only 1 bit (0 = white, 1 = black), might look like this as a grid, spelling a rough diagonal line:

1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

Read left-to-right, top-to-bottom, this is stored as the single bit sequence 1000 0100 0010 0001 — 16 bits total, exactly matching the 16 pixels (4 × 4) at 1 bit each.

Colour depth — how many colours are possible?

Colour depth determines how many distinct colours a pixel can represent, following the same "n bits gives 2ⁿ possibilities" rule you met with binary numbers:

Colour depthPossible coloursTypical use
1 bit2 (black/white only)Simple monochrome icons
8 bits256Older/simple graphics, limited colour
24 bits16,777,216 (about 16.7 million)Standard modern "true colour" photos

Calculate it — the file size formula

File size (in bits) = width × height × colour depth. Divide by 8 to convert to bytes, then by 1024 repeatedly for KB/MB as needed (covered fully in the Data Storage Calculations lesson).

Worked example 1: a 100 × 100 pixel image at 24-bit colour depth: 100 × 100 × 24 = 240,000 bits. Converting to bytes: 240,000 ÷ 8 = 30,000 bytes (about 29.3 KB).

Worked example 2: the same 100 × 100 image, but at 8-bit colour depth instead: 100 × 100 × 8 = 80,000 bits = 10,000 bytes — exactly a third of the 24-bit version's size, because colour depth scales the file size directly and linearly.

Worked example 3: a much larger 1920 × 1080 photo at 24-bit colour depth: 1920 × 1080 × 24 = 49,766,400 bits, which is 6,220,800 bytes — roughly 5.93 MB, illustrating why real photos are so much larger than simple icons.

Check your understanding — calculate it yourself

Calculate the file size, in bytes, for a 200 × 150 pixel image at 8-bit colour depth. (200 × 150 × 8 = 240,000 bits = 30,000 bytes.)

Evaluate — resolution and colour depth trade-offs

Increasing resolution adds more pixels, capturing finer detail but increasing file size roughly proportionally to the area (doubling both width and height quadruples the pixel count). Increasing colour depth allows smoother, more realistic colour gradients but increases file size linearly. A simple app icon needs neither high resolution nor high colour depth; a professional photograph benefits from both, at the direct cost of a much larger file.

Challenge

A camera can save photos at either 4000 × 3000 pixels (24-bit colour) or a "compact" mode at 2000 × 1500 pixels (24-bit colour). Calculate the file size of each in MB (using 1 MB = 1,000,000 bytes for simplicity), and explain what you notice about the relationship between the two sizes given that both dimensions were exactly halved.

Looking ahead: the next lesson (Sound Representation) applies the exact same "sample something real, store a fixed number of bits per sample" logic to audio — the underlying mathematics of the file-size formula will look strikingly familiar.

Practise

Apply what you've just learned in the Coding Lab.

Open Coding Lab

Test yourself

Check your understanding with exam-style questions.

Go to Exam Practice
Log in to track this lesson on your progress dashboard.
Log in