66 exam-style questions plus unlimited generated ones on this topic, at up to four difficulty levels, with full mark schemes. Notes and past-paper booklets are open to everyone. Practice needs a free account.
Or take a quick quiz: 10 questions on this subtopic in GCSE Computer Science (Edexcel), marked as you tap.
How bitmap images are stored in binary as a grid of pixels, and how resolution and colour depth affect image quality and file size. Expect definitions, questions on reading or writing pixel codes, 'explain the effect' questions and file size expressions.
Key facts
Pixel = the smallest single-coloured element of a bitmap image
Divide by 8 for bytes, then by 1024 for KiB and by 1024 again for MiB.
Example: 256 × 128 pixels with a colour depth of 8 bits: 256 × 128 × 8 = 262,144 bits = 32,768 bytes = 32 KiB.
Work out the pixel data only, unless the question tells you otherwise.
How to answer each type of question
Define the key terms
1 mark eachGrade 4
Pixel: the smallest element of the image, a single colour.
Colour depth: use the words 'number of bits' and 'each pixel'.
Resolution: the number of pixels, width × height.
Example. (a) Define the term 'colour depth'. (b) State the number of different colours that can be represented with a colour depth of 5 bits.
Show the model answerHide the model answer
(a) The number of bits used to store the colour of each pixel
(1)
(b) 32 (25)
(1)
Encode a small image
2 marksGrade 5
Use the colour codes given in the question.
Work along each row from left to right.
Number of bits = number of pixels × colour depth.
Example. A bitmap image is 4 pixels wide and 2 pixels high. It has a colour depth of 2 bits and uses these codes:
Colour
Code
white
00
green
01
blue
10
black
11
The colours of the pixels are:
Pixel 1
Pixel 2
Pixel 3
Pixel 4
Row 1
white
green
green
black
Row 2
blue
blue
white
white
(a) Give the binary code for row 1. (b) State the number of bits needed to store the whole image.Show the model answerHide the model answer
(a) 00 01 01 11
(1)
(b) 8 pixels × 2 bits = 16 bits
(1)
Explain the effect of changing resolution or colour depth
2 marksGrade 6
Say what happens to the image quality, and why.
Say what happens to the file size, and by how much if you can.
Use numbers from the question.
Example. A photographer reduces the resolution of a photo from 4000 × 3000 pixels to 2000 × 1500 pixels. The colour depth is unchanged. Explain the effect of this change on the photo and on its file size.
Show the model answerHide the model answer
There are fewer pixels, so less detail can be shown and the photo may look pixelated when it is enlarged (1). Only a quarter as many pixels are stored (3,000,000 instead of 12,000,000), so the file size is a quarter of the original (1).
Construct an expression for the file size of an image
2 to 3 marksGrade 7
Multiply width × height to get the number of pixels.
Multiply by the colour depth to get bits.
Divide by 8 for bytes, then by 1024 for each step up (KiB, MiB).
You do not have to work it out unless the question asks you to.
Example. A bitmap image is 1200 pixels wide and 900 pixels high, with a colour depth of 24 bits. Construct an expression to calculate the file size of the image in mebibytes (MiB). You do not need to do the calculation.
Show the model answerHide the model answer
1200 × 900 × 24 (1) ÷ 8 (1) ÷ 1024 ÷ 1024 (1)
Don’t lose marks
Defining colour depth as 'the number of colours'. It is the number of bits per pixel.
Forgetting to divide by 8 to change bits into bytes.
Dividing by 1000 instead of 1024 when converting to KiB or MiB.
Saying a higher resolution means 'bigger pixels'. It means more pixels.
Giving only one effect when the question asks about quality and file size.
More tips
Memory tricks
Colour depth to colours: 2 to the power of the bits. Colours to colour depth: the smallest power of 2 that is enough.
Double the colour depth and the file size doubles. Double both the width and the height and there are four times as many pixels, so the file is four times as big.
Divide early to keep numbers small: 24 bits = 3 bytes per pixel, so the size in bytes is width × height × 3.
'Construct an expression' only needs the expression: marks are given for each stage (bits, bytes, then the final unit).
When explaining a change, cover both sides: what happens to the quality and what happens to the file size.
Quote numbers from the context (e.g. 256 colours instead of 16) to make an explanation precise.
What each grade needs
What you need to be able to do, from the first marks up to the top grade.
Grade 3
Define pixelThe smallest single-coloured element (dot) of a bitmap image.
Grade 4
Define resolution and colour depthResolution is the number of pixels (width × height); colour depth is the number of bits per pixel.
Grade 5
Find the number of coloursA colour depth of n bits gives 2n colours, e.g. 8 bits give 256.
Grade 5
Encode and decode a simple bitmapUse the given code for each colour to turn the pixels into binary, row by row.
Grade 6
Explain effects of changing resolution or colour depthMore pixels or more bits per pixel improve quality but increase the file size.
Grade 7
Construct a file size expression for an imagewidth × height × colour depth gives bits; ÷ 8 for bytes, then ÷ 1024 for KiB.
Grade 8
Work backwards to find colour depthColour depth = total bits ÷ number of pixels, after converting the size into bits.
Quick recall
Cover the answers and test yourself. The app has these as flashcards that come back just before you'd forget them.
Define the term 'pixel'.
The smallest single-coloured element (dot) of a bitmap image.
Give the number of colours that can be represented by a colour depth of 2 bits.
4
State the number of bytes in 1 kibibyte (1 KiB).
1,024
State the smallest colour depth, in bits, that can store 16 different colours.
4 bits
When the number of pixels in an uncompressed image is increased, the file size ………… .
increases
A row of eight pixels in a two-colour image is stored using 1 for black and 0 for white. From left to right the pixels are: white, black, black, white, black, white, white, black. Write the binary pattern that is stored for this row.
01101001
Sample questions
Written for this site in the style of Edexcel exam questions. They are not taken from real past papers.
Question 1Easy3 marks
(a) Define the term 'pixel'.
[1]
(b) Define the term 'colour depth'.
[1]
(c) State the number of different colours that can be represented with a colour depth of 3 bits.
[1]
Show the answer and mark scheme
(a)Answer: The smallest single-coloured element (dot) of a bitmap image.
the smallest element of a bitmap image / a single point (dot) of one colour in the image
(b)Answer: The number of bits used for each pixel’s colour.
the number of bits used to store the colour of each pixel
(c)Answer: 8
8 (23)
Question 2Medium4 marks
A photo-editing app allows a user to change the colour depth and the resolution of a bitmap image.
(a) Explain the effect of reducing the colour depth of a photo from 24 bits to 8 bits.
[2]
(b) Explain the effect of increasing the resolution of the photo.
[2]
Show the answer and mark scheme
(a)Answer: Only 256 colours instead of over 16 million, so the photo looks less realistic, but the file is a third of the size.
fewer colours can be represented (256 instead of 16,777,216), so the photo looks less realistic / colours may appear as bands
the file size is reduced (to a third of the original)
(b)Answer: More pixels give more detail and a sharper image, but the file size increases.
there are more pixels, so more detail can be shown / the image is sharper / less pixelated
more pixels must be stored, so the file size increases
Question 3Hard5 marks
A game uses a small sprite that is 4 pixels wide and 3 pixels high with a colour depth of 2 bits. The colour codes are: 00 = white, 01 = red, 10 = blue and 11 = black. The sprite is stored row by row, starting with the top row: