Unit 11.3A · Term 3

Image Representation: Bitmaps

A bitmap represents an image as a rectangular grid of pixels. Each pixel stores a colour value. The amount of detail and the amount of storage required depend mainly on the resolution and colour depth.

Learning Objectives

  • 11.1.1.5 Explain how bitmaps are represented in terms of number of pixels, resolution, and colour depth
  • 11.1.1.6 Calculate the size of a bitmap image file

How a Bitmap Represents an Image

Bitmap image shown as a grid of pixels, with one pixel enlarged and a 24-bit RGB example
A bitmap stores a colour value for every pixel position.
Pixel

The smallest addressable picture element in a bitmap image.

Resolution

The pixel dimensions of the image, usually written as width × height.

Colour depth

The number of bits used to represent the colour of one pixel.

Resolution in these calculations

In this topic, resolution is normally given as pixel dimensions such as 1920 × 1080. Pixel density such as PPI is related, but it is not used in the bitmap-size formula unless a question explicitly asks for it.

Resolution & Number of Pixels

Comparison of low and higher bitmap resolution showing a smoother shape with more pixels
Higher resolution uses more pixels and can represent finer detail.

1 Calculate total number of pixels

Resolution = 1920 × 1080 Total pixels = width × height = 1920 × 1080 = 2,073,600 pixels ≈ 2.07 megapixels
If resolution increases...Effect
Number of pixelsIncreases
Possible image detailGenerally increases
Uncompressed storage requirementIncreases if colour depth stays the same

Doubling both dimensions does not double the pixels

800 × 600 = 480,000 pixels, but 1600 × 1200 = 1,920,000 pixels — four times as many.

Colour Depth

Examples of 1-bit, 2-bit, 4-bit, 8-bit and 24-bit colour depths and their number of possible colours
More bits per pixel allow more possible colour values.

2 Number of possible colours

Number of colours = 2^(colour depth) 1 bit → 2¹ = 2 colours 4 bits → 2⁴ = 16 colours 8 bits → 2⁸ = 256 colours 24 bits → 2²⁴ = 16,777,216 colours

24-bit RGB

A common 24-bit representation uses 8 bits for red + 8 bits for green + 8 bits for blue. The colour depth is 24 bits per pixel, not 24 bits per channel.

If colour depth increases...Effect
Bits stored per pixelIncreases
Possible coloursIncreases exponentially: 2^n
Colour detail / gradientsCan improve
Uncompressed file sizeIncreases if resolution stays the same

Calculating Bitmap Image Size

Flow showing bitmap file size calculation from width, height and colour depth
Start in bits, then convert units only if the question requires it.
Uncompressed pixel data (bits) = width × height × colour depth

3 Example: 640 × 480, 8-bit colour

Number of pixels = 640 × 480 = 307,200 pixels Size in bits = 307,200 × 8 = 2,457,600 bits Size in bytes = 2,457,600 ÷ 8 = 307,200 bytes Size in KiB = 307,200 ÷ 1024 = 300 KiB

4 Example: 1920 × 1080, 24-bit colour

Size in bits = 1920 × 1080 × 24 = 49,766,400 bits Size in bytes = 49,766,400 ÷ 8 = 6,220,800 bytes Size in MiB = 6,220,800 ÷ 1024 ÷ 1024 ≈ 5.93 MiB

Unit conversions

This page uses 1024 bytes = 1 KiB and 1024 KiB = 1 MiB. If an exam question explicitly gives a different conversion such as 1000 bytes = 1 kB, use the conversion stated in the question.

Formula result vs actual file size

width × height × colour depth calculates the raw, uncompressed pixel data. A real image file may also contain headers/metadata, and some formats may use compression, so its actual size on disk can differ.

The Quality–Storage Trade-off

ChangePossible benefitCost
Increase resolutionMore spatial detailMore pixels to store
Increase colour depthMore possible colours / smoother gradientsMore bits for every pixel
Reduce resolution / colour depthLess storage and bandwidthPossible loss of image detail or colour quality

Interactive Labs

1. Resolution Calculator

Enter pixel dimensions and calculate the total number of pixels.
Enter width and height, then calculate.

2. Colour Depth Challenge

Use 2^(colour depth).

3. Bitmap Size Calculator

Calculate the uncompressed pixel-data size.
Formula: width × height × colour depth.

4. Predict the Effect

Choose the strongest answer.

Common Pitfalls

Resolution is not colour depth

Resolution describes how many pixel positions the image has. Colour depth describes how many bits are used for each pixel.

Colour depth is not the number of colours

An 8-bit colour depth does not mean 8 colours. It gives 2^8 = 256 possible colour values.

Forgetting bits → bytes

After width × height × depth, the result is in bits. Divide by 8 to obtain bytes.

Raw formula ≠ every actual file size

Headers, metadata and compression can change the size of a real image file.

Doubling width and height

Doubling both dimensions multiplies the number of pixels by four, not two.

Graded Tasks

Remember

Define pixel, resolution and colour depth.

Understand

Explain how a bitmap image is represented digitally.

Apply

Calculate the total number of pixels in a 1280 × 720 image.

Apply

Calculate the number of possible colours for 4-bit, 8-bit and 16-bit colour depth.

Understand

Explain two effects of increasing the resolution while keeping colour depth unchanged.

Apply

Calculate the uncompressed size in bytes of a 1024 × 768 image with 8-bit colour depth.

Analyze

Compare two 800 × 600 images with colour depths of 8 bits and 24 bits. Explain the effect on possible colours and storage.

Analyze

A developer needs to reduce image storage. Discuss the consequences of reducing resolution versus reducing colour depth.

Exam Practice

Q1: Explain how a bitmap image is represented using pixels and colour depth. [3]

Reveal marking points
Image is divided into a grid of pixels [1]. Each pixel stores a colour value [1]. Colour depth determines the number of bits used to represent each pixel / possible colours [1].

Q2: An image has a resolution of 1600 × 900. Calculate the total number of pixels. [1]

Reveal marking points
1600 × 900 = 1,440,000 pixels [1].

Q3: A bitmap uses 6-bit colour depth. Calculate the maximum number of possible colours. [2]

Reveal marking points
2^6 [1]. 64 colours [1].

Q4: A 640 × 480 bitmap uses 16-bit colour depth. Calculate its uncompressed pixel-data size in bytes. [3]

Reveal marking points
640 × 480 = 307,200 pixels [1]. 307,200 × 16 = 4,915,200 bits [1]. 4,915,200 ÷ 8 = 614,400 bytes [1].

Self-Check Quiz

Eight quick checksClick each answer to reveal
1. What is a pixel?
Click to reveal answer
2. What does 1920 × 1080 describe?
Click to reveal answer
3. How many pixels are in a 100 × 100 image?
Click to reveal answer
4. What does colour depth measure?
Click to reveal answer
5. How many colours can 8 bits represent?
Click to reveal answer
6. What is the raw bitmap-size formula in bits?
Click to reveal answer
7. How do you convert bits to bytes?
Click to reveal answer
8. Why might an actual image file differ from the raw calculation?
Click to reveal answer