
20 Image and Video Compression
Algorithm—Any sequence of identical symbols will be replaced by a coun-
ter identifying the number of repetitions and the particular symbol (e.g.,
sssss will be coded as 5s.
Example—For example, consider an image of a blackboard that has white
characters on a black background. It will be composed of many long runs of
blackpixelsin the blank space, and many short runs of white pixels within
for the characters. Let us consider a singlescanline, with B representing a
black pixel and W representing white:
BBBBBBBBBBBBWBBBBBBBBBBBB WWWBBBBBBBBBBBBBBBBBBBBBBBBWBBBBBBBB
BBBBBB
By applying a run-length encoding algorith