
Originally Posted by
Intrinsic
It uses the Deflate implementation from 7-Zip and a genetic algorithm to select filters, really interesting!
OptiPNG uses the heuristic defined in RFC2083:
"The following simple heuristic has performed well in early tests: compute the output scanline using all five filters, and select the filter that gives the smallest sum of absolute values of outputs. (Consider the output bytes as signed differences for this test.) This method usually outperforms any single fixed filter choice. However, it is likely that much better heuristics will be found as more experience is gained with PNG."
I believe that PNGOUT uses different heuristics, pngcheck can be used to display the filter used on each line:
Code:
pngcheck -vv twit.png
File: twit.png (2013 bytes)
chunk IHDR at offset 0x0000c, length 13
32 x 32 image, 32-bit RGB+alpha, non-interlaced
chunk IDAT at offset 0x00025, length 1956
zlib: deflated, 32K window, fast compression
row filters (0 none, 1 sub, 2 up, 3 avg, 4 paeth):
1 4 4 4 1 1 1 1 4 4 4 4 4 4 4 4 4 4 4 4 4 2 4 4 1
1 1 1 1 3 1 1 (32 out of 32)
chunk IEND at offset 0x007d5, length 0