The shape of the lesson
By the end of the lesson, learners can
- How a bitmap is encoded: In the lab, change the resolution and the colour depth of the image.
- Estimating file size: The pixel data is width × height × colour depth bits.
- Vector graphics: The lab's bitmap or vector mode enlarges both kinds of image.
- File size: width × height × colour depth bits; ÷ 8 for bytes, ÷ 1024 for KiB.
- Colour depth: n bits give 2n colours; find the smallest n that is enough.
- Vector: drawing list of drawing objects, each with properties; scales without pixelation.
- Justify: bitmap for photographs; vector for logos, diagrams and anything resized often.
One picture every idea returns to
A bitmap is a grid of pixels; each pixel stores a binary colour code. The colour depth (bit depth) is the number of bits per pixel, so it allows 2n colours. The image resolution is the number of pixels (width × height). A file header stores data about the image, such as its dimensions and colour depth. Estimated file size = width × height × colour depth bits. A vector graphic is a drawing list of drawing objects, each described by its properties, so it can be scaled without losing quality.
Forty-five minutes, phase by phase
| Time | Phase | What happens in the room | Grouping |
|---|---|---|---|
| 0 to 5 min | Hook: predict | Open with the question in the title, Pixels or shapes?. A photo and a logo can look alike on screen, but they are stored in completely different ways. 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 min | Teach and check: How a bitmap is encoded | In the lab, change the resolution and the colour depth of the image. Project tab 3 of the lab (Resolution and colour depth) and let a student drive it while the class predicts. | Whole class, then pairs |
| 13 to 21 min | Teach and check: Estimating file size | The pixel data is width × height × colour depth bits. Model the worked example Full HD photo on the board, one line at a time. Your turn: Estimate the size of a 640 × 480 image with 24-bit colour, in KiB. | Pairs |
| 21 to 30 min | Teach and check: Vector graphics | The lab's bitmap or vector mode enlarges both kinds of image. Project tab 6 of the lab (Bitmap or vector) and let a student drive it while the class predicts. | Mix-Pair-Share |
| 30 to 36 min | Check | The 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 min | Plenary | The 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 min | Exit and homework | Set the worksheet below (6 questions, 18 marks). Learners self-assess against the objectives before they leave. | Individual |
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 Vector graphics, 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.
Mix-Pair-Share
Students mix around the room until you call pair; they pair with the nearest classmate, discuss the prompt, then mix again. Three prompts of rising difficulty, three different partners.
The full structure, with its variations and the other twelve, is on the cooperative-learning page.
What to head off, and how
| Trap learners fall into | Teaching move that pre-empts it |
|---|---|
| Do not confuse image resolution with screen resolution. | Image resolution belongs to the file; screen resolution belongs to the display. |
| Multiplying by the number of colours instead of the colour depth is the most common error. 256 colours means 8 bits per pixel, not 256. | Return to Estimating file size: ask a pair to state the correct version and show it on the lab before moving on. |
| "Vectors are smaller" is not always true. | A complex scene with thousands of objects can need a larger vector file than a bitmap, and vectors cannot realistically store a photograph. |
Bitmap and vector graphics: worksheet
6 questions, 18 marks. Written in the style of the papers; no past paper question is reproduced.
Define the terms pixel, image resolution and colour depth.
A bitmap is 2048 pixels wide and 1536 pixels high, with a colour depth of 16 bits. Estimate its file size in MiB. Show your working.
Explain the effect of increasing the colour depth of a bitmap image on its quality and on its file size.
Describe how a vector graphic is encoded.
A school needs (a) a photograph of its sports team for its website and (b) its crest, which will be printed on letters, shirts and a large banner. Justify whether each should be a bitmap or a vector graphic.
A 1200 × 800 pixel image must be able to show at least 200 different colours. Calculate the minimum colour depth and the estimated file size in KiB.
Answer key and marking notes
- Pixel: the smallest addressable element of a bitmap image, with one colour.
- Image resolution: the number of pixels in the image (width × height).
- Colour depth: the number of bits used to represent the colour of each pixel.
- 2048 × 1536 = 3 145 728 pixels.
- × 2 bytes = 6 291 456 bytes.
- 6 291 456 ÷ 1 048 576 = 6 MiB.
- More colours can be represented, so colours are more accurate / gradients are smoother.
- More bits are stored per pixel, so the file size increases (in proportion to the colour depth).
- It is stored as a drawing list (a list of commands).
- Each item is a drawing object, such as a line, circle or rectangle.
- Each object has properties, e.g. coordinates, radius, line colour, line width, fill colour.
- (a) Bitmap.
- A photograph has many complex colour changes that cannot be described by simple shapes.
- (b) Vector.
- The crest is made of shapes and can be scaled to any size without losing quality / becoming pixelated.
- 27 = 128 is too few and 28 = 256 is enough, so 8 bits.
- 1200 × 800 = 960 000 pixels × 1 byte = 960 000 bytes.
- 960 000 ÷ 1024 = 937.5 KiB.
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.
What is meant by the colour depth of a bitmap image?
- AThe number of bits used to represent the colour of each pixel
- BThe number of pixels in the image, given as width × height
- CThe number of different colours the screen can display
- DThe number of pixels in each inch of the printed image
Estimate the file size of an 800 × 600 bitmap image that uses 256 colours. Ignore the file header.
- A468.75 KiB
- B15 000 KiB
- C3750 KiB
- D480 KiB
A bitmap image is edited so that its width and its height are both doubled and its colour depth goes from 8 bits to 16 bits. By what factor does the file size (ignoring the header) increase?
- A8
- B4
- C6
- D2
What does a vector graphic file store?
- AA drawing list of objects, each described by properties such as position, size and fill colour
- BA binary colour code for every pixel in the image grid
- COnly a file header giving the width, height and colour depth
- DThe image as runs of identical pixels with a count for each run
Which statement comparing bitmap and vector graphics is correct?
- AA scene with thousands of drawing objects can need a larger file as a vector than as a bitmap
- BA vector file is always smaller than a bitmap of the same picture
- CEnlarging a vector graphic makes it pixelated because the pixels are stretched
- DA photograph is stored most efficiently as a vector graphic
A 1024 × 768 bitmap image needs exactly 1.5 MiB, ignoring the file header. What is its colour depth?
- A16 bits
- B2 bits
- C24 bits
- D65 536 bits
Quiz key
Colour depth is bits per pixel, so n bits allow 2n colours. Width × height is the image resolution, what the screen can display is a property of the display, and pixels per inch describes print density, not how each pixel is encoded.
256 = 28, so 8 bits (1 byte) per pixel: 800 × 600 = 480 000 bytes = 480 000 ÷ 1024 = 468.75 KiB. 15 000 KiB multiplies by 256 instead of 8, 3750 KiB leaves the answer in bits, and 480 KiB divides by 1000 but labels the result as kibibytes.
Doubling width and height multiplies the number of pixels by 2 × 2 = 4, and doubling the colour depth multiplies by another 2: 4 × 2 = 8. 4 forgets the colour depth, 6 adds the factors instead of multiplying, and 2 only counts one change.
A vector file holds a drawing list: commands for objects such as circles and lines, with their properties. Storing a colour code for every pixel describes a bitmap, a header alone cannot rebuild an image, and counts of identical pixels describe run-length encoding of a bitmap.
Every object and its properties must be stored, so a very complex scene can produce a larger vector file than the bitmap. Vectors are usually smaller only for simple shapes. Vectors are recalculated when scaled, so they do not pixelate, and photographs with continuous colour changes are stored as bitmaps.
1.5 MiB = 1.5 × 1 048 576 × 8 = 12 582 912 bits, and 1024 × 768 = 786 432 pixels, so 12 582 912 ÷ 786 432 = 16 bits per pixel. 2 is the answer in bytes per pixel, 24 bits would give 2.25 MiB, and 65 536 is the number of colours that 16 bits allow, not the depth.
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 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.