Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Online Courses / University Track / Computing Foundations

Module 2 · Lesson 4 · Core

Pictures and file sizes

Estimate how much storage an image needs from its pixels, and handle the units bit, byte and kilobyte.

  • 50 minutes
  • Serves O2
  • Assumes M2.L3

Phase 1: Prepare

Step 1 Warm-up recall

From M2.L3: how many bytes does the word “data” take as plain English text?

Private: nothing you type here is sent or stored.

Step 2 Learning goal

By the end of this lesson you can:

  • define pixel and colour value (Foundation);
  • compute the size of an uncompressed image (Core);
  • convert between bits and bytes (Core).

Phase 2: Teach

Step 3 A familiar example

A one-sentence text message and a small photograph are both “data”, yet the photograph takes far more space. Counting pixels shows why.

Step 4 Clear explanation

A digital image is a grid of tiny squares called pixels. Each pixel stores a colour as numbers. In a common scheme, a pixel stores three numbers, one each for red, green and blue, each from 0 to 255, so each colour uses one byte (8 bits) and each pixel uses 3 bytes. The size of an uncompressed image is therefore the number of pixels multiplied by the bytes per pixel.

ImagePixelsBytes per pixelSize (bytes)
Small icon10 × 10 = 1003300
Banner100 × 50 = 5,000315,000
Black and white 8 × 8641 bit (not 1 byte)64 bits = 8 bytes

A 100 × 50 image has 5,000 pixels and, at 3 bytes each, needs 15,000 bytes. Units: 1 byte is 8 bits. A kilobyte (kB) is 1,000 bytes in the standard decimal (SI) system; some software uses 1,024 bytes and calls it a kibibyte (KiB). So 15,000 bytes is 15 kB. Real files are usually smaller because compression stores repeated patterns in fewer bits, but the uncompressed size is the starting point for any estimate, and you can use it to compare the cost of storing text with the cost of storing pictures.

Notice how this connects to Module 1: the size estimate is itself a short method with a defined input (width, height, bytes per pixel) and output (bytes), the kind of problem stated precisely in the algorithm entry.

Step 5 Worked example (4 marks)

An uncompressed 40 × 30 image uses 3 bytes per pixel. How many bytes?

  1. Pixels = 40 × 30 = 1,200. (1 mark)
  2. Bytes = 1,200 × 3 = 3,600. (1 mark)
  3. In kilobytes: 3,600 ÷ 1,000 = 3.6 kB. (1 mark)
  4. In bits: 3,600 × 8 = 28,800 bits. (1 mark)

Phase 3: Practise

Step 6 Learner practice (instant-marked)

1. A pixel is:

2. A 10 × 10 image at 3 bytes per pixel is:

3. 1 byte equals:

4. Compression is used to:

Phase 4: Close

Step 7 Recap

  • An image is a grid of pixels; each stores colour numbers.
  • Uncompressed size = pixels × bytes per pixel.
  • 1 byte = 8 bits; 1 kB = 1,000 bytes in the SI system.

Step 8 Exit ticket (ungraded)

Compute the uncompressed size of a 20 × 10 image at 3 bytes per pixel.

Private: nothing you type here is sent or stored.

Step 9 Go further (Extension)

Compute how many bytes a 1,000-character message needs, and compare it with the 15,000-byte banner.

Common mistakes

MistakeWhy it fails
Counting bits when the question asks for bytesDivide by 8 to go from bits to bytes.
Forgetting the three colour valuesMultiply by bytes per pixel.
Assuming the file size equals the uncompressed sizeCompression usually makes files smaller.

Limits. Real image formats add headers, use compression and may use more or fewer bits per colour; the sizes here are estimates for teaching.