Teachers' Portal  /  IGCSE Computer Science 0478  /  Data representation  /  Representing images: resolution and colour depth
Lesson pack · IGCSE Computer Science 0478 · 1.2 · IGCSE

Representing images: resolution and colour depth

Pictures made of pixels. Zoom far enough into any digital photo and it breaks up into tiny squares of colour called pixels.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Data representation
Syllabus reference
Cambridge IGCSE Computer Science 0478, 1.2
Level
IGCSE
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 8 of 10 in Data representation; follows Representing sound: sample rate and resolution; leads into Measuring data storage and calculating file sizes
Central model
Fig. 1: a tiny black and white image stored row by row as 1s and 0s
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • Pixels in binary: In the lab, paint a few pixels and read off the binary stored for each row.
  • Resolution and quality: Lower the resolution in the lab and the image becomes blocky (pixelated); lower the colour depth and the colours become banded.
  • Image file size: Every pixel needs (colour depth) bits, so multiply the number of pixels by the colour depth.
Key points to leave on the board
  • Resolution: number of pixels (width × height).
  • Colour depth: bits per pixel; n bits give 2n colours.
  • Higher either: better quality, bigger file.
  • Size: width × height × colour depth bits, then ÷ 8 and ÷ 1024 as needed.
The core visual model

One picture every idea returns to

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
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Pictures made of pixels.. Zoom far enough into any digital photo and it breaks up into tiny squares of colour called pixels. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: Pixels in binaryIn the lab, paint a few pixels and read off the binary stored for each row. Project tab 3 of the lab (Pixels and binary) and let a student drive it while the class predicts. Your turn: How many colours can be shown with a colour depth of 6 bits?Whole class, then pairs
13 to 21 minTeach and check: Resolution and qualityLower the resolution in the lab and the image becomes blocky (pixelated); lower the colour depth and the colours become banded. Project tab 3 of the lab (Resolution and colour depth) and let a student drive it while the class predicts.Pairs
21 to 30 minTeach and check: Image file sizeEvery pixel needs (colour depth) bits, so multiply the number of pixels by the colour depth. Model the worked example Size of a photo on the board, one line at a time. Your turn: An image is 100 × 50 pixels with a colour depth of 4 bits. What is its size in bytes?Frayer Model
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 12 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Image file size, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Frayer Model

Pairs fill a four-box grid for the key term: definition, characteristics, examples and non-examples. The non-examples box is where the misconceptions surface, so give it the most time.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
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.Return to Pixels in binary: ask a pair to state the correct version and show it on the lab before moving on.
Resolution is the number of pixels in the image, such as 800 × 600.It is not the size of the picture in centimetres.
Worksheet

Representing images: resolution and colour depth: worksheet

6 questions, 12 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · explain[2 marks]

Explain how a computer represents an image in binary.

Q2 · recall[2 marks]

Define resolution and colour depth.

Q3 · calculate[3 marks]

An image is 1024 pixels wide and 768 pixels high with a colour depth of 16 bits. Calculate the file size in KiB. Show your working.

Q4 · calculate[1 mark]

State how many different colours can be represented with a colour depth of 12 bits.

Q5 · apply[2 marks]

A 640 × 480 image has a colour depth of 1 bit. The colour depth is changed to 8 bits. State the effect on the file size and on the image.

Q6 · analysis[2 marks]

A designer needs an image format that can show 300 different colours. A student suggests a colour depth of 8 bits. Explain whether this is enough and state the smallest suitable colour depth.

Answer key and marking notes
Q1 · 2 marks
  • The image is made of a series of pixels.
  • The colour of each pixel is stored as a binary number, using the number of bits set by the colour depth.
Q2 · 2 marks
  • Resolution: the number of pixels in the image.
  • Colour depth: the number of bits used to represent each colour (pixel).
Q3 · 3 marks
  • 1024 × 768 × 16 = 12 582 912 bits.
  • 12 582 912 ÷ 8 = 1 572 864 bytes.
  • 1 572 864 ÷ 1024 = 1536 KiB.
Q4 · 1 mark

212 = 4096 colours.

Q5 · 2 marks
  • The file size becomes 8 times larger.
  • The image can now show 256 colours instead of 2, so it can look more realistic.
Q6 · 2 marks
  • 8 bits give only 28 = 256 colours, which is fewer than 300, so it is not enough.
  • 9 bits give 512 colours, so 9 bits is the smallest suitable colour depth.
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

What is meant by the resolution of an image?

  • AThe number of pixels in the image
  • BThe number of bits used for each pixel
  • CThe number of different colours in the image
  • DThe physical size of the image when printed
Q21 mark

An image has a colour depth of 4 bits. How many different colours can each pixel be?

  • A16
  • B4
  • C8
  • D15
Q31 mark

The black-and-white image shown is stored using the smallest possible colour depth. What is its file size?

8 pixels wide, 6 pixels high, black and white only
  • A48 bits
  • B6 bits
  • C96 bits
  • D384 bits
Q41 mark

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

  • A8 bits
  • B7 bits
  • C200 bits
  • D16 bits
Q51 mark

An image is 1024 pixels wide and 768 pixels high with a colour depth of 24 bits. What is its file size in MiB?

  • A2.25 MiB
  • B2.36 MiB
  • C18 MiB
  • D2304 MiB
Q61 mark

An image of 1600 × 1200 pixels is resized to 800 × 600 pixels with the same colour depth. What happens to the file size?

  • AIt becomes a quarter of the original
  • BIt becomes half of the original
  • CIt stays the same, because the colour depth is unchanged
  • DIt becomes an eighth of the original
Quiz key
Q1: A

Resolution is the number of pixels, width × height. The number of bits per pixel is the colour depth, and the number of colours available depends on the colour depth, not the resolution. The printed size depends on how it is printed, not on the term resolution used here.

Q2: A

24 = 16 different patterns, from 0000 to 1111, so 16 colours. 4 is the number of bits. 8 is 4 × 2 rather than 24. 15 is the largest code, but 0000 is also a colour, so there are 16.

Q3: A

Two colours need a colour depth of 1 bit (0 or 1). There are 8 × 6 = 48 pixels, so 48 × 1 = 48 bits. 6 bits counts only one row or column. 96 bits uses 2 bits per pixel, which is more than 2 colours need. 384 bits uses 8 bits per pixel. The number of black pixels does not matter: every pixel is stored.

Q4: A

7 bits give 27 = 128 colours, which is too few; 8 bits give 256, which is enough. 200 bits confuses the number of colours with the number of bits. 16 bits would work but is not the smallest.

Q5: A

1024 × 768 × 24 = 18 874 368 bits; ÷ 8 = 2 359 296 bytes; ÷ 1024 = 2304 KiB; ÷ 1024 = 2.25 MiB. 2.36 divides the bytes by 1 000 000 instead of 1024 × 1024. 18 MiB skips dividing by 8. 2304 is the size in KiB, labelled with the wrong unit.

Q6: A

The width and height are both halved, so the number of pixels is ½ × ½ = ¼ of the original (480 000 instead of 1 920 000), and the file size falls to a quarter. Half only accounts for one dimension. Colour depth is per pixel, so fewer pixels still means a smaller file. An eighth would need a third halving, such as halving the colour depth too.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonRepresenting sound: sample rate and resolution