Show understanding of the effects of changing elements of a bitmap image on the image quality and file size

Published by Patrick Mutisya · 14 days ago

Cambridge A-Level Computer Science – 1.2 Multimedia

1.2 Multimedia – Bitmap Images

Objective

Show understanding of the effects of changing elements of a bitmap image on the image quality and file size.

Key Elements of a Bitmap Image

  • Resolution (dimensions) – number of pixels in width × height.
  • Colour depth (bits per pixel) – number of bits used to represent the colour of each pixel.
  • Compression – method used to reduce file size (lossless vs lossy).
  • File format – determines how the above elements are stored (e.g., BMP, PNG, JPEG).

How Each Element Affects Quality and File Size

  1. Resolution

    Increasing the number of pixels raises the total pixel count:

    \$\text{Total pixels}= \text{width} \times \text{height}\$

    More pixels give finer detail (higher quality) but increase file size roughly proportionally to the pixel count.

  2. Colour Depth

    Each pixel requires \$b\$ bits, where \$b\$ is the colour depth. File size (uncompressed) can be estimated by:

    \$\text{File size (bits)} = \text{width} \times \text{height} \times b\$

    Higher colour depth allows more colours (better gradients, less banding) but also enlarges the file.

  3. Compression

    Two main types:

    • Lossless – no visual information is lost (e.g., PNG, GIF). File size reduction is limited, typically 2–3 : 1 for typical images.
    • Lossy – some information is discarded (e.g., JPEG). Greater reduction (10 : 1, 20 : 1 or more) but may introduce artefacts such as blocking or blurring.

    The compression ratio determines the trade‑off between file size and perceived quality.

  4. File Format

    Different formats implement colour depth and compression differently. For example:

    • BMP – uncompressed, stores full colour depth → large files.
    • PNG – lossless compression, supports up to 48‑bit colour → moderate size, high quality.
    • JPEG – lossy compression, typically 8‑bit colour → small size, possible quality loss.

Summary Table

ElementEffect on Image QualityEffect on File Size
Resolution (pixels)Higher resolution = more detail, smoother edgesFile size ∝ width × height (linear increase)
Colour Depth (bits per pixel)More colours = smoother gradients, less bandingFile size ∝ colour depth (linear increase)
Lossless CompressionNo visual degradationTypical reduction 2–3 : 1; depends on image complexity
Lossy CompressionPotential artefacts (blocking, blurring) if compression highHigh reduction (10 : 1 up to 50 : 1); size inversely related to quality setting
File FormatDetermines how colour depth & compression are appliedVaries: BMP > PNG > JPEG in typical size for same image

Practical Example

Consider a photograph of 800 × 600 px.

  1. Uncompressed BMP, 24‑bit colour:

    \$\text{Size}=800 \times 600 \times 24 \text{ bits}=11\,520\,000 \text{ bits}\approx 1.44\text{ MB}\$

  2. Saved as PNG (lossless):

    • Typical size ≈ 0.6 MB (≈ 2.4 : 1 reduction).

  3. Saved as JPEG with quality 80 %:

    • Typical size ≈ 0.15 MB (≈ 9.6 : 1 reduction) with slight loss of sharpness.

Suggested diagram: A grid of pixels showing how increasing resolution adds more squares, and a colour palette illustrating colour depth.

Key Points to Remember

  • Higher resolution and colour depth improve visual fidelity but increase file size linearly.
  • Compression reduces file size; lossless preserves quality, lossy sacrifices quality for greater reduction.
  • Choosing the appropriate file format balances the needs of quality, file size, and intended use (e.g., web vs print).