5 views

1 Answers

Modified Huffman coding is used in fax machines to encode black-on-white images. It combines the variable-length codes of Huffman coding with the coding of repetitive data in run-length encoding.

The basic Huffman coding provides a way to compress files that have much repeating data, like a file containing text, where the alphabet letters are the repeating objects. However, a single scan line contains only two kinds of elements – white pixels and black pixels – which can be represented directly as a 0 and 1. This "alphabet" of only two symbols is too small to directly apply the Huffman coding. But if we first use run-length encoding, we can have more objects to encode. Here is an example taken from the article on run-length encoding:

A hypothetical scan line, with B representing a black pixel and W representing white, might read as follows:

With a run-length encoding data compression algorithm applied to the above hypothetical scan line, it can be rendered as follows:

5 views

Related Questions