Image file size in the unit asked

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Image file size in the unit asked

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. An image is 4096 bytes. What is its size in KiB?
A 4 KiB
B 4096 KiB
2. The image size is 5242880 bytes and the question asks for MiB. How many times do you divide by 1024?
A Twice (bytes to KiB, then KiB to MiB)
B Once
3. An image is 1024 x 1024 pixels with a colour depth of 8 bits. What is its size in MiB?
A 1 MiB
B 8 MiB
4. An image is 2048 x 1024 pixels with a colour depth of 24 bits. What is its size in MiB?
A 48 MiB
B 6 MiB
5. An image uses 256 different colours. Which value do you use for the colour depth in the file size calculation?
A 256 bits per pixel
B 8 bits per pixel

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1bytes / 1024 A2 ^ 8 = 256, so depth = 8
2bytes / 1024 / 1024 BIt multiplies by 1024 instead of dividing. A KiB is bigger than a byte, so the number must get smaller. Use bytes / 1024.
3A 1024 x 512 image with a colour depth of 16 bits, with the size given in MiB: bits to bytes, then divide by 1024 twice CConverts an image size in bytes to MiB
4An image that uses 256 colours needs a colour depth of 8 bits per pixel, because 2 to the power of 8 is 256 Dw * h * depth is in bits, but the code never divides by 8 to get bytes. It should be (w * h * depth) / 8 / 1024.
5size_KiB = bytes * 1024 EConverts an image size in bytes to KiB
6size_KiB = (w * h * depth) / 1024 F1024 * 512 * 16 / 8 / 1024 / 1024

Definitions

bytes / 1024 / 1024

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
kib = bytes / ____
2.
mib = bytes _ 1024 / 1024
3.
bits = 1024 * 1024 * 24 bytes = bits / _ mib = bytes / 1024 / 1024
4.
colours = 256 depth = _ bits = 1920 * 1080 * depth
5.
kib = bytes / 1024 mib = kib / ____

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A pixels = 800 + 600
B bits = pixels * 8
C bytes = bits / 8
D KiB = bytes / 1024
Question 2
A pixels = 1024 * 768
B bits = pixels / 16
C bytes = bits / 8
D MiB = bytes / 1024 / 1024
Question 3
A pixels = 640 * 480
B bits = pixels * 24
C bytes = bits * 8
D KiB = bytes / 1024
Question 4
A colours = 16
B depth = 4
C bits = 400 * 300 * colours
D bytes = bits / 8
Question 5
A bytes = 3145728
B KiB = bytes / 1024
C MiB = KiB / 1024 / 1024

Answer Key

Image file size in the unit asked
Section A: Quick Questions
Q1
A — 4 KiB
Q2
A — Twice (bytes to KiB, then KiB to MiB)
Q3
A — 1 MiB
Q4
B — 6 MiB
Q5
B — 8 bits per pixel
Section B: Match the Pairs
Q1
bytes / 1024 → Converts an image size in bytes to KiB
Q2
bytes / 1024 / 1024 → Converts an image size in bytes to MiB
Q3
A 1024 x 512 image with a colour depth of 16 bits, with the size given in MiB: bits to bytes, then divide by 1024 twice → 1024 * 512 * 16 / 8 / 1024 / 1024
Q4
An image that uses 256 colours needs a colour depth of 8 bits per pixel, because 2 to the power of 8 is 256 → 2 ^ 8 = 256, so depth = 8
Q5
size_KiB = bytes * 1024 → It multiplies by 1024 instead of dividing. A KiB is bigger than a byte, so the number must get smaller. Use bytes / 1024.
Q6
size_KiB = (w * h * depth) / 1024 → w * h * depth is in bits, but the code never divides by 8 to get bytes. It should be (w * h * depth) / 8 / 1024.
Section C: Definitions
Q1
bytes / 1024 / 1024 — After finding an image size in bytes, divide by 1024 once for KiB, twice for MiB and three times for GiB, to give the answer in the unit the question asks for.
Section D: Fill in the Blanks
Q1
kib = bytes / 1024
Q2
mib = bytes / 1024 / 1024
Q3
bits = 1024 * 1024 * 24 bytes = bits / 8 mib = bytes / 1024 / 1024
Q4
colours = 256 depth = 8 bits = 1920 * 1080 * depth
Q5
kib = bytes / 1024 mib = kib / 1024
Section E: Spot the Error
Q1
A — The number of pixels is width multiplied by height, so line 1 should be pixels = 800 * 600. Adding them gives the wrong pixel count.
Q2
B — The image size in bits is pixels multiplied by colour depth, so line 2 should be bits = pixels * 16. Dividing makes the size far too small.
Q3
C — There are 8 bits in a byte, so converting bits to bytes means dividing by 8. Line 3 should be bytes = bits / 8.
Q4
C — The size uses the colour depth in bits (4 bits for 16 colours), not the number of colours. Line 3 should be bits = 400 * 300 * depth.
Q5
C — The value is already in KiB, so only one more division by 1024 gives MiB. Line 3 should be MiB = KiB / 1024. Dividing twice goes one unit too far.