Huffman Coding

Method

Example Image (3 bits per pixel)










Huffman code table

levelcountcodebits
14512,1530024,306
7215,7720131,544
10927,3711154,742
2184,431100017,724
365,175100120,700
1826,388101125,552
01,174101005,870
2554.3361010121,680



202,128

Compression ratio

raw 320 * 240 * 3 = 230,400

ratio 230,400/202,128 = 1.140

Other schemes

  packed 28,800  (320*240*3 bits / 8 bits-per-byte)
  GIF    14,290  (includes colormap, original gif 33,674)
  winzip 14,150  (includes directory info overhead)
  gzip   13,845
  jpeg   19,971  (original jpeg 16,866)


Maintained by John Loomis, last updated July 29, 1997