Cambridge IGCSE · Topic 1.2
IGCSE Computer Science 0478 / Topic 1 / IGCSE

Pictures made of pixels.

Zoom far enough into any digital photo and it breaks up into tiny squares of colour called pixels. Each pixel's colour is stored as a binary number, so the number of pixels and the bits per pixel decide how sharp the image looks and how big the file is.

The key idea

An image is a series of pixels (picture elements), and the colour of each pixel is converted to binary so the computer can process it. The resolution is the number of pixels in the image (width × height). The colour depth is the number of bits used to represent each colour; n bits give 2n possible colours. As resolution and colour depth increase, the quality and the file size both increase.

a 6 × 5 image with a colour depth of 1 bit 100001100001111111100001100001 1 = black, 0 = white: one bit per pixel 30 pixels × 1 bit = 30 bits
Fig. 1: a tiny black and white image stored row by row as 1s and 0s
Section 01

Pixels in binary.

In the lab, paint a few pixels and read off the binary stored for each row. Then raise the colour depth and see each pixel need more bits.

Colour depthColours possibleTypical use
1 bit2black and white
4 bits16simple icons
8 bits256simple graphics
24 bits16 777 216photographs (8 bits each for red, green and blue)
Your turn
How many colours can be shown with a colour depth of 6 bits?
Examiner trap

Colour depth is a number of bits, not a number of colours. "A colour depth of 256" is wrong; say 8 bits, which gives 256 colours.

Section 02

Resolution and quality.

Lower the resolution in the lab and the image becomes blocky (pixelated); lower the colour depth and the colours become banded. Both make the file smaller.

Examiner trap

Resolution is the number of pixels in the image, such as 800 × 600. It is not the size of the picture in centimetres.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

What is the resolution of an image?

Quick check+10 XP

What is the colour depth of an image?

Quick check+10 XP

How many colours can a colour depth of 8 bits represent?

Quick check+10 XP

In the lab, the colour depth is raised from 1 bit to 8 bits with the same resolution. What happens to the file size?

Section 03

Image file size.

Every pixel needs (colour depth) bits, so multiply the number of pixels by the colour depth.

Worked example Size of a photo
An image is 800 pixels wide and 600 pixels high with a colour depth of 24 bits. Calculate its file size in KiB.
  1. Pixels = 800 × 600 = 480 000.
  2. Bits = 480 000 × 24 = 11 520 000 bits.
  3. Bytes = 11 520 000 ÷ 8 = 1 440 000 bytes.
  4. KiB = 1 440 000 ÷ 1024 = 1406.25 KiB.
Answer: 1406.25 KiB
Your turn
An image is 100 × 50 pixels with a colour depth of 4 bits. What is its size in bytes?
Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

An image uses only 2 colours. What is the smallest colour depth it can use?

Exam style+20 XP

An image is 100 × 100 pixels with a colour depth of 8 bits. What is its file size?

Exam style+20 XP

What is the effect of reducing the resolution of an image?

Exam style+20 XP

An image needs to show 50 different colours. What is the smallest colour depth that can do this?

Skill unlocked

Representing images, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Pixels in binary, resolution and colour depth, their effect on quality and file size, and image file size calculations.