-
Notifications
You must be signed in to change notification settings - Fork 0
Benchmarks
YadeWira edited this page Jun 13, 2026
·
1 revision
precomp is the reference byte-exact PNG recompressor (also preflate-based). It treats a PNG as a deflate stream and re-compresses it with LZMA2; packPNG un-filters to pixels and uses an image codec. Both reproduce the original file byte-for-byte.
17 real-world PNGs (1.52 MB), 56-core Xeon E5-2690 v4. Every row byte-exact (17/17). Lower ratio = smaller = better.
| backend | approach | ratio | encode | decode |
|---|---|---|---|---|
| TCIP (default) | preflate + WebP-lossless | 45.7 % | 2.38 s | 0.72 s |
TMCP (-preflate-max) |
preflate + kanzi-TPAQX | 47.6 % | 11.8 s | 11.5 s |
TPCL (-tpcl) |
preflate + MT-LZMA2 | 64.3 % | 1.68 s | 0.58 s |
TVCP (-fast) |
kanzi + zstd | 85.6 % | 0.39 s | 0.04 s |
| precomp 0.4.8 | preflate + LZMA2 | 75.3 % | 2.21 s | 0.98 s |
- TCIP (the default) is 39 % smaller than precomp — modelling the image with WebP-lossless beats LZMA2-on-deflated-bytes.
- TPCL uses precomp's exact recipe (preflate + LZMA2) yet wins on all three axes (smaller and faster), thanks to a newer preflate + multi-threaded LZMA2.
- precomp's
-intense/-brutedon't change PNG results (~75 %); they only help raw/embedded zlib in other container types.
Speed methodology: packPNG times are
-th0(parallel across files); precomp is per-file (no batch mode). For a single file precomp's speed is competitive (it multi-threads LZMA2 internally); packPNG's edge is in batch. Ratio is mode-independent.
- 162/162 PngSuite valid PNGs round-trip byte-exact.
- 14/14 intentionally-corrupt PngSuite files handled without crashes.
- Encode is deterministic (same input → identical SHA-256), incl. Linux ↔ Windows.