Fill in the blanksQuestion 1 · Recall
Loading…
By the end you can compress a bitmap image with RLE, calculate its compressed size, and explain which kinds of image RLE suits.
A bitmap stores a colour code for every pixel, row by row, left to right. Line those codes up and neighbouring pixels of the same colour form runs, exactly like the AAAAs in text.
RLE stores each run as a pair: (number of pixels, colour code).
Worked example: The heart in numbers
The 12 × 8 heart uses 8-bit colour. Each RLE run is stored as a 1-byte count and a 1-byte colour code, and runs stop at the end of each row. Compare the uncompressed and compressed sizes.