Question 1
1 markOne row of a black and white image is stored using run length encoding as:
4 0 2 1 3 0
Each pair is the number of pixels followed by the colour code, where 0 is white and 1 is black.
State the original binary data for this row of pixels.
Model answer
000011000 (4 white, 2 black, 3 white).
Explanation
Read the data in pairs: (4, 0) means four 0s, (2, 1) means two 1s and (3, 0) means three 0s. Writing them out in order rebuilds the row exactly, which is why RLE is lossless.
Mark scheme
-
1 mark
000011000
accept with or without spaces; must be 9 bits