Huffmix compares two PNG files produced by PNGOUT in random mode and cherry-picks the smallest deflate blocks to combine them into a new file.
PNG compression is based on Deflate (by Phillip Katz, first introduced in PKZIP). A deflate stream is made of one or more blocks.
Ken Silverman's PNGOUT is a powerful PNG optimization tool based on its own deflate algorithm (not the commonly used zlib)
- PNGOUT lets you choose how many blocks it produces (-n option, or -b to set the block split threshold).
- PNGOUT has a random switch (-r randomized initial tables "good for many trials with same options").

For instance if we have 3 blocks.
File A:
block 1: 110 bits
block 2: 317 bits
block 3: 272 bits
Overall: 699 bits

File B:
block 1: 104 bits
block 2: 312 bits
block 3: 289 bits
Overall: 705 bits

Until now you would have kept File A and deleted File B (since A is smaller than B), Huffmix combines File A and File B into File C by picking the smallest blocks, this gives:

File C:
block 1: 104 bits (from File B)
block 2: 312 bits (from File B)
block 3: 272 bits (from File A)
Overall: 688 bits

We end up with a smaller file and managed to take profit of the calculations done to produce the biggest file, it works like a catalyst.
Of course since there's randomness involved it will not always work as demonstrated, nevertheless my first tests suggests that it actually works pretty well.

Huffmix 0.4b2:
- Linux i686 (32 bits)
- Linux x64 (64 bits)
- Mac OS X PowerPC & Intel
- Windows NT/2000/XP/Vista/7

Current version notes:
New options:
-q Quiet
-k Keep same block structure as in first file

Version 0.4b1
- Asymmetric block support

Version 0.3b2
- First version released
Under Construction

Last update: 14 September 2011 by Frederic Kayser
Valid HTML 3.2!