Calculating the size of a bitmap image

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

Calculating the size of a bitmap image

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which formula gives the size of an uncompressed bitmap image in bits?
A width x height x bits per pixel
B width + height + bits per pixel
2. A black and white image is 8 pixels wide and 8 pixels tall, using 1 bit per pixel. How many bits does it need?
A 16 bits
B 64 bits
3. An image needs 64 bits. How many bytes is that?
A 8 bytes
B 512 bytes
4. To change the size of an image from bits to bytes, what do you do?
A Divide by 8
B Multiply by 8
5. An RGB image is 10 pixels wide and 10 pixels tall at 24 bits per pixel. How many bits is it?
A 240 bits
B 2400 bits

Match the Pairs

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

Left columnRight column
1width x height x bits per pixel AThe numbers were added instead of multiplied. The correct sum is 20 x 10 x 24 = 4800 bits.
2size in bits / 8 B10 x 10 x 1 = 100 bits
3A black and white image uses 1 bit per pixel. An image that is 10 pixels wide and 10 pixels high is this many bits. CBits were multiplied by 8 instead of divided by 8. The correct answer is 8000 / 8 = 1000 bytes.
4An RGB image uses 24 bits per pixel. An image that is 100 pixels wide and 50 pixels high is this many bits. DGives the size of an uncompressed bitmap image in bits
5A 20 x 10 image at 24 bits: 20 + 10 + 24 = 54 bits EConverts the image size from bits to bytes
6An image of 8000 bits is 8000 x 8 = 64000 bytes F100 x 50 x 24 = 120000 bits

Definitions

width x height x bits per pixel

Fill in the Blanks

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

1.
sizeBits = width * ______ * bitsPerPixel
2.
sizeBits = 16 * 16 * 1 sizeBytes = sizeBits _ 8
3.
width = 8 height = 8 sizeBits = width * height * _
4.
bitsPerPixel = __ sizeBits = 100 * 100 * bitsPerPixel
5.
sizeBytes = 4096 sizeKB = sizeBytes / ____

Spot the Error

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

Question 1
A width ← 100
B height ← 50
C bits ← width + height * 1
D bytes ← bits / 8
Question 2
A bitsPerPixel ← 24
B bits ← 20 * bitsPerPixel
C bytes ← bits / 8
Question 3
A bwBits ← 24
B bits ← 64 * 64 * bwBits
C bytes ← bits / 8
Question 4
A rgbBits ← 3
B bits ← 10 * 10 * rgbBits
C bytes ← bits / 8
Question 5
A width ← 16
B height ← 16
C bits ← width * height
D bytes ← bits / 8

Answer Key

Calculating the size of a bitmap image
Section A: Quick Questions
Q1
A — width x height x bits per pixel
Q2
B — 64 bits
Q3
A — 8 bytes
Q4
A — Divide by 8
Q5
B — 2400 bits
Section B: Match the Pairs
Q1
width x height x bits per pixel → Gives the size of an uncompressed bitmap image in bits
Q2
size in bits / 8 → Converts the image size from bits to bytes
Q3
A black and white image uses 1 bit per pixel. An image that is 10 pixels wide and 10 pixels high is this many bits. → 10 x 10 x 1 = 100 bits
Q4
An RGB image uses 24 bits per pixel. An image that is 100 pixels wide and 50 pixels high is this many bits. → 100 x 50 x 24 = 120000 bits
Q5
A 20 x 10 image at 24 bits: 20 + 10 + 24 = 54 bits → The numbers were added instead of multiplied. The correct sum is 20 x 10 x 24 = 4800 bits.
Q6
An image of 8000 bits is 8000 x 8 = 64000 bytes → Bits were multiplied by 8 instead of divided by 8. The correct answer is 8000 / 8 = 1000 bytes.
Section C: Definitions
Q1
width x height x bits per pixel — The size of an uncompressed bitmap image in bits. Multiply width by height by the bits used for each pixel, then divide by 8 to get bytes.
Section D: Fill in the Blanks
Q1
sizeBits = width * height * bitsPerPixel
Q2
sizeBits = 16 * 16 * 1 sizeBytes = sizeBits / 8
Q3
width = 8 height = 8 sizeBits = width * height * 1
Q4
bitsPerPixel = 24 sizeBits = 100 * 100 * bitsPerPixel
Q5
sizeBytes = 4096 sizeKB = sizeBytes / 1024
Section E: Spot the Error
Q1
C — The size in bits is width x height x bits per pixel, so width and height must be multiplied, not added. It should be bits ← width * height * 1.
Q2
B — The height of the image has been left out. The pixel count is width x height, so it should be bits ← 20 * 10 * bitsPerPixel.
Q3
A — A black and white image only needs 1 bit per pixel (0 or 1). 24 bits per pixel is for RGB colour images. It should be bwBits ← 1.
Q4
A — An RGB pixel uses 3 bytes, which is 24 bits (8 bits each for red, green and blue). The formula needs bits per pixel, so it should be rgbBits ← 24.
Q5
C — The bits used for each pixel are missing. Width x height only gives the number of pixels. It should be bits ← width * height * 24.