Historical reference only. Use ECT for a one-shot ultimate solution.
Why obsolete? PNGOptim orchestrates PNGOUT/Zopfli in heuristic passes; ECT uses Zopfli with the BT match finder from 7-Zip's Deflate, effectively closing the gap where Zopfli underperformed.
However PNGOptim can still possibly speed up the process by only selecting proper zopfli
--filtersbut that's usually not a great advance given our PCs are much faster than before.References
- Rationale and internals: DEFLATE.md
- Quick comparison of ECT: https://github.com/yumeyao/7zDeflate
- Legacy notes still valid for background: project WIKIs
Note on
CgBIHelper(previously undocumented): Converts between standard PNGs and iOS CgBI PNGs. CgBI adds a privateCgBIchunk, stores raw DEFLATE inIDAT(no zlib wrapper), and uses BGRA + premultiplied alpha. To optimize, re-wrap IDAT in zlib and leave pixels unchanged to get a valid (if visually wrong) PNG that standard tools can recompress.
PNGOptim is a CMD Batch file (Why?) for optimizing PNG files, aiming at good quality(small file size) with less effort(less tries hence runs faster).
It's inspired by similar projects such as ImageOptim, Trimage, etc.. However, PNGOptim doesn't follow all other projects' brute way, instead it only uses PNGOut and Zopflipng (Why?) in a smart way.
PNGOptim runs generally faster and the output is generally smaller because it's SMART not BRUTE.
- Multi-CPU ready
- Smart approach(not brute)
- Multi-Files at one time
- Safe for multiple instances
- Download the batch file (you can right-click and choose save).
- Ensure you have a copy of PNGOut, Zopflipng and DeflOpt and they are accessable(you can just put the exe files to the same directory as the batch file)
As a respect of the authors, I DON'T contain the exe files in this project - Now use it to optimize PNG files. They are optimized in-place.
- Drag'n'Drop PNGs to the batch file or d'n'd folders.
- Use the syntax "pngoptim pngfile1 pngfile2 pngfile3 pngfile4 ...".
- Just run the command to see more syntax.
- On XP Home/2000, wmic is not present, assuming 2 logical CPUs.
- Search for "InitParallel 2" and replace 2 in case you want to change the numbers on such OSes.
- Unicode paths that is not valid in current code page fails.
- As the sychronization is file-based. There is an astronomically small chance the synchronation goes broken if you run multiple instances at the same time.
However it's not recommended to run multiple instances and it's not needed, you doesn't benefit from doing so.
- log in verbose mode.