Objective: Understand how data for a bitmapped image are encoded
Bitmapped (raster) images store colour information for each individual pixel. The way this information is encoded determines the file size, colour fidelity and the types of operations that can be performed efficiently.
Key Concepts
Pixel (picture element) – the smallest addressable element of an image, defined by its position (x, y) and colour value.
Resolution – the number of pixels in the horizontal and vertical directions, usually expressed as width × height (e.g., 1920 × 1080).
Colour depth (bits per pixel, bpp) – the number of bits used to represent the colour of a single pixel.
Palette (colour table) – a list of colours that can be referenced by an index; used in indexed colour images.
RGB model – each colour is represented by three components: red, green and blue.
Bit planes – the set of bits at the same position across all pixels; useful for certain image processing techniques.
Colour Encoding Methods
1. Direct (True‑colour) Encoding
Each pixel stores its colour directly, usually as separate red, green and blue components.
24‑bit colour: 8 bits for each of R, G, B → \$2^{8}=256\$ levels per channel, \$256^3 = 16{,}777{,}216\$ possible colours.
32‑bit colour: adds an 8‑bit alpha channel for transparency.
2. Indexed (Palette‑based) Encoding
Pixels store an index into a colour table (palette). The palette holds the actual RGB values.
Common palette sizes: 2, 4, 16, 256 colours (corresponding to 1, 2, 4, 8 bpp).
Reduces file size when the image uses a limited set of colours.
Calculating Image Data Size
The amount of data required for a bitmap image can be estimated with the following formula:
Compatibility – some devices or software only support certain colour depths.
Suggested diagram: A visual comparison of a 2‑bpp indexed image versus a 24‑bpp true‑colour image of the same scene, highlighting the difference in colour richness and pixel data layout.