Adaptive PNG filtering backfired, inflating 7 of 8 test animations by up to 2.4x
A developer adding adaptive per-scanline filtering to an APNG encoder discovered the feature made seven out of eight test animations larger, with one cicada-molting clip ballooning to 2.41 times its original size. Testing all five PNG filters applied uniformly across every scanline showed that each fixed filter also performed worse than no filtering on the same seven files. The root cause lies in a conflict between how the minimum-sum-of-absolute-differences heuristic selects filters and how DEFLATE compression actually rewards byte repetition. Because the heuristic optimises for low byte magnitude rather than compressibility, it routinely picks filters that break up long runs of identical bytes, hurting DEFLATE. The author concluded that untested optimisation assumptions are effectively guesses, and that a single controlled experiment — forcing one filter constant — revealed what three correlational metrics had failed to show.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in