Medium3 marksStructured
AQA GCSE · Question 12 · Fundamentals of data representation
Figure 1 shows a 10 x 8 bitmap image that uses three colours. Calculate the minimum file size that would be required to store the bitmap image in Figure 1. Give your answer in bytes. Show your working.
Figure 1 shows a 10 x 8 bitmap image that uses three colours. Calculate the minimum file size that would be required to store the bitmap image in Figure 1. Give your answer in bytes. Show your working.
How to approach this question
1. **Calculate total pixels:** Multiply the image width by its height.
2. **Calculate bits per pixel (colour depth):** Find the smallest power of 2 that is greater than or equal to the number of colours. The exponent is the number of bits needed. (e.g., for 3 colours, 2^1=2 is not enough, but 2^2=4 is. So you need 2 bits).
3. **Calculate total bits:** Multiply the total number of pixels by the bits per pixel.
4. **Convert to bytes:** Divide the total number of bits by 8 (since there are 8 bits in a byte).
Full Answer
20 bytes.
Working:
1. Number of pixels = width × height = 10 × 8 = 80 pixels.
2. Minimum bits per pixel = ceil(log2(number of colours)) = ceil(log2(3)). 2^1=2 (too small), 2^2=4 (sufficient). So, 2 bits are needed per pixel.
3. Total bits = number of pixels × bits per pixel = 80 × 2 = 160 bits.
4. Convert bits to bytes: Total bytes = Total bits / 8 = 160 / 8 = 20 bytes.
To calculate the minimum file size of a bitmap image, we need to determine the total number of pixels and the number of bits required to store the colour of each pixel (the colour depth).
1. **Calculate the total number of pixels:**
The image is 10 pixels wide and 8 pixels high.
Total pixels = Width × Height = 10 × 8 = 80 pixels.
2. **Calculate the minimum bits per pixel (colour depth):**
The image uses 3 colours. We need to find the smallest number of bits, `n`, such that 2^n is greater than or equal to the number of colours.
- If n=1, 2^1 = 2 colours (not enough).
- If n=2, 2^2 = 4 colours (this is enough to represent 3 colours).
So, we need a minimum of 2 bits per pixel.
3. **Calculate the total file size in bits:**
Total bits = Total pixels × Bits per pixel = 80 × 2 = 160 bits.
4. **Convert the file size to bytes:**
There are 8 bits in 1 byte.
Total bytes = Total bits / 8 = 160 / 8 = 20 bytes.
Common mistakes
✗ Forgetting to calculate the bits per pixel and just using the number of colours (e.g., 80 * 3).
✗ Using the wrong number of bits per pixel (e.g., 3 bits instead of 2).
✗ Forgetting to convert the final answer from bits to bytes by dividing by 8.
✗ Making a calculation error.
Practice the full AQA GCSE Computer Science Paper 2
46 questions · hints · full answers · grading
More questions from this exam
Q01.1Convert the binary number 11010100 into decimal.EasyQ01.2Convert the binary number 10111001 into hexadecimal. You should show your working.MediumQ01.3State the largest decimal number that can be represented using 6 bits.EasyQ02.1Add together the following three binary numbers and give your answer in binary.
00110110
1001...MediumQ02.2Apply a binary shift three places to the right on the bit pattern 10101000. Give the result using...Easy
Expert