oxipng vs zopflipng on 12 PNGs: the winner changed with the image group
If you have both oxipng and zopflipng installed, which one should run on a folder of PNGs? I wanted a straight answer, so on 2026-11-05 I ran both on 12 PNGs from Wikimedia Commons on an Apple M4 Mac: 6 transparent files
If you have both oxipng and zopflipng installed, which one should run on a folder of PNGs? I wanted a straight answer, so on 2026-11-05 I ran both on 12 PNGs from Wikimedia Commons on an Apple M4 Mac: 6 transparent files (3 icons and 3 illustrations, all with real alpha from 0 to 255), 3 photos saved as PNG and 3 screenshots. Short version: zopflipng won on transparent files, oxipng on screenshots, and the photo group changed sides between two runs and again after pngquant. Everything here is one run on a small set, sizes are in bytes, and I did not score visual quality at all.
These are the four commands, with pngquant 3.0.3, oxipng 10.2.1 and zopflipng from zopfli 1.0.3_1. The --nx line is there to separate plain recompression from oxipng's lossless reductions, like dropping an alpha channel that is fully opaque.
oxipng -o 4 --strip safe --out out.png in.png
oxipng -o 4 --strip safe --nx --out out.png in.png
zopflipng -y --filters=01234mepb in.png out.png
pngquant --quality=65-80 --speed 4 --output q.png in.png
For batches in a desktop browser I use the image compressor in ImgIng https://imging.ai/ , which processes files locally. Browser tools like it follow the same reduce-colors-then-recompress idea. Its output is not in any table below.
Lossless alone gave a split result
| Group (measured 2026-11-05) | Original | oxipng | zopflipng | Smaller |
|---|---|---|---|---|
| Transparent, 6 files | 501,130 | 444,175 (-11.4%) | 429,153 (-14.4%) | zopflipng |
| Photo PNG, 3 files | 2,063,192 | 1,551,821 (-24.8%) | 1,526,978 (-26.0%) | zopflipng, this run |
| Screenshot, 3 files | 1,890,089 | 1,440,266 (-23.8%) | 1,492,922 (-21.0%) | oxipng |
The transparent group is the cleanest contest. All six files use real transparency, so oxipng had nothing to reduce, and its --nx run landed on exactly the same 444,175 bytes as the full run. That leaves deflate and filter choice, and zopflipng came out 3 points ahead. It also held on the two transparent files I broke down: the Afro Mobile Icon went from 23,375 to 15,363 with oxipng and 15,023 with zopflipng, and Anime girl from 220,260 to 217,261 and 211,689. My guess is that this is simply zopfli doing what it was built for, squeezing deflate harder, but I have not checked it beyond these numbers.
Screenshots went the other way. The Book screenshot is RGBA with every alpha at 255, and both tools dropped the alpha and wrote RGB, so the raw data after inflating was the same 8,829,020 bytes for both. oxipng still finished at 1,121,084 against 1,180,008 for zopflipng. With the same color type and the same raw size, the gap has to come from filters and deflate, and why zopflipng lost here is something I did not dig into. For the whole screenshot group, oxipng's reductions alone were worth 9.3 points, 14.5% with --nx against 23.8% without it.
The photo result changed between two runs
I had run the same files with the same parameters on 2026-10-29. oxipng gave identical numbers both times. zopflipng did not: the photo group came out at 1,624,722 on 2026-10-29 and 1,526,978 on 2026-11-05, each from a single run. The earlier figure loses to oxipng's 1,551,821 and the later one wins. The screenshot group moved too, from 1,584,237 to 1,492,922 (again one run each), though it lost to oxipng both times. I did not look into the reason, so I won't claim zopflipng is better on photos.
A good part of the photo saving is not deflate anyway. Two of the three photos are RGBA with every alpha at 255. On Steve Selvin, dropping that channel cut the raw data from 3,258,917 to 2,444,413 bytes before any compression. Alekszej Fedoricsev is a grayscale photo with only 222 colors, and oxipng turned it into a palette PNG without touching a pixel, 407,150 to 167,225 bytes (-58.9%). Of oxipng's 24.8% on this group, 6.5 points came from reductions like these. Three photos, two with a useless alpha channel, is too few to generalize from.
Quantizing first moved the photo group to oxipng
| Group, after pngquant 65β80 (measured 2026-11-05) | pngquant | then oxipng | then zopflipng | Smaller |
|---|---|---|---|---|
| Transparent | 115,382 (-77.0%) | 104,707 (-79.1%) | 100,196 (-80.0%) | zopflipng |
| Photo PNG | 694,735 (-66.3%) | 612,968 (-70.3%) | 631,628 (-69.4%) | oxipng |
| Screenshot | 601,760 (-68.2%) | 565,455 (-70.1%) | 561,874 (-70.3%) | zopflipng, by 3,581 bytes |
Percentages are against the original files. On the transparent group the quantizer saved 77.0% by itself, and oxipng after it added 2.1 points.
The photo group flipped. On Steve Selvin zopflipng was still smaller after quantizing, 379,537 against 386,812. The loss came from the other two files, where oxipng's default run beat its own --nx run by a lot: Alekszej 100,267 against 118,264, Directiva 125,889 against 134,882. --nx turns off reductions, including reordering the palette, so my reading is that palette reordering helped on those two. Steve Selvin went the opposite way, 386,812 by default and 380,655 with --nx, so treat that as a per-file effect.
What I take from this set: on transparent icons and illustrations, pngquant then zopflipng gave the smallest total of the combinations I ran. On screenshots, oxipng alone beat zopflipng alone, and after quantizing the two ended up 3,581 bytes apart. On photo PNGs a single run flipped the winner, so running both and keeping the smaller file is the safer choice on this set. The bigger decision sits one step earlier, in whether a palette is acceptable for that image at all, because that step moved far more bytes than the choice between the two optimizers.
Sample images from Wikimedia Commons: Adaptability icon (unknown author, CC0), Afro Mobile Icon by Ben plc (public domain), Blue star icon stylized by PrazerCambraia (CC0), Adenosine triphosphate ball-and-stick by FreeCliparts (CC0), Anime girl by oksmith (CC0), Apple cartoon with transparent background by Toby8991 (CC0), Alekszej Fedoricsev by Javelin Bayraktar (CC0), Directiva junto a presidente APPA by JaimeRuix (CC BY-SA 4.0), Steve Selvin by UC Berkeley Public Health (CC BY 4.0), 2011 Talend MDM studio by Copyleft (CC BY-SA 3.0), 2019-06-19 OpenProject by Benoit Soubeyran by Mazuritz (CC BY-SA 4.0), 2020-06-29 Screenshot The Book Fort Monmouth - Fort Montagu by Stefan KΓΌhn (CC0).
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.