Using pngcrush:
pngcrush -rem alla -rem text input.png better.png
Using Oxipng:
oxipng --strip all input.png -o better.png
❌ "PNG can't be compressed without quality loss."
✅ False: Lossless compression exists. Visually lossless is also possible. png to png better
❌ "Converting PNG to JPG and back makes a smaller PNG."
✅ Dangerous: JPG artifacts become permanent. Never re-encode JPG to PNG for size.
❌ "More colors always look better."
✅ False: 256-color PNG often looks identical to 24-bit for UI and graphics. Using pngcrush :
pngcrush -rem alla -rem text input
Use PNG-8 when color palette allows; use PNG-24 when color fidelity and smooth gradients matter.
npm install -g imagemin-cli
imagemin input.png --out-dir=output --plugin=pngquant
How to do it:
Use ZopfliPNG (via command line) or tools like ImageOptim (macOS) and FileOptimizer (Windows). Using Oxipng :
oxipng --strip all input
zopflipng --iterations=15 --filters=0me original.png better.png
Result: A PNG that is 5-15% smaller than the original, with zero visual degradation. This is the purest form of "PNG to PNG better."
To consistently produce better PNGs from PNGs, integrate optimization into your pipeline: