Search⌘ K

Huffman Encoding

Explore Huffman encoding to understand how variable length, prefix-free codes reduce data storage needs in images. Learn the construction of Huffman trees and how this method creates efficient codes that avoid decoding conflicts, enhancing data compression without loss.

Huffman codes

There are four unique values in the grayscale image in Figure 11, so let’s give each one a variable length code 0, 1, 001, 11, as shown in Table 1. How did we assign these codes? We’ll discuss this a bit later in the lesson. On average, the required amount of storage would be 0.145 ×\times 1 ++ 0.400 ×\times 1 ++ ...

Figure 1:  A grayscale image represented by four grayscale values.
Figure 1: A grayscale image represented by four grayscale values.