Codecs
May 14, 2026·7 min read

Optimizing PNGs with OxiPNG and pngquant

Learn how palette reduction, filters, and deflate optimization compress heavy PNG images.

MV

Marcus Vance

Contributing Author · Squoosh Next Blog

PNG files are notorious for large sizes because the lossless deflate compression engine cannot exploit the psychovisual redundancy that lossy codecs leverage. OxiPNG, written in Rust, optimizes PNG files by systematically testing all combinations of row filters (none, sub, up, average, Paeth) and zlib compression levels (1–9) to find the minimal valid PNG bitstream without changing a single pixel. For even greater savings, pngquant performs 8-bit palette reduction using a modified median-cut algorithm, mapping millions of colors to a 256-color index.

Combining pngquant palette reduction followed by OxiPNG deflate optimization can yield 65–72% size reduction over unoptimized PNG while retaining transparency and pixel-sharp edges.

Key Takeaways
  • PNG files are notorious for large sizes because the lossless deflate compression engine cannot exploit the psychovisual redundancy that lossy codecs leverage.

  • OxiPNG, written in Rust, optimizes PNG files by systematically testing all combinations of row filters (none, sub, up, average, Paeth) and zlib compression levels (1–9) to find the minimal valid PNG bitstream without changing a single pixel.

  • For even greater savings, pngquant performs 8-bit palette reduction using a modified median-cut algorithm, mapping millions of colors to a 256-color index.

  • Combining pngquant palette reduction followed by OxiPNG deflate optimization can yield 65–72% size reduction over unoptimized PNG while retaining transparency and pixel-sharp edges.

Try It in the Workspace

Everything discussed in this article can be tested directly in Squoosh Next — no sign-up, no upload, 100% client-side.

More in Codecs
AVIF vs WebP: The Next-Gen Image Format Showdown
June 12, 2026 · 6 min read
A Deep-Dive into JPEG XL (JXL)
March 05, 2026 · 8 min read
How Trellis Quantization Improves JPEG Quality
January 14, 2026 · 6 min read
Squoosh Next

Professional client-side image compression and format optimization tool. Compress, convert, and adjust 100+ formats instantly without server uploads.


© 2026 Squoosh Next. Developed & Maintained by Naushad Alam | Zest Tech Solution | Powered by Vercel.Contact: Naushad Alam | WhatsApp: 7492068998 | Email: contact@zestcommerce.in | Web: zesttechsolution.cloud
Security EncryptedNo Uploads
Operational
v2.1.0Commit: d05d63e
0s
Build Info
Environment: productionBranch: masterBuild Time: 25s
Deployment
Deployed: 7/13/2026, 12:09:18 AMUptime: 0sPlatform: Vercel
Performance
Response: 0msStatus: OnlineSSL: Active
Technology
Next.js: 16.2.9React: 19.0.0TypeScript: 5.0