What Makes PNG Special?
PNG (Portable Network Graphics) is the go-to format for images that demand sharp edges and transparency - logos, UI screenshots, illustrations, and icons. Unlike JPEG, PNG was designed to be a lossless format, meaning every pixel is preserved exactly as the original.
But this fidelity comes at a cost: PNG files are often much larger than their JPEG or WebP equivalents. A typical screenshot can easily be 2–5MB as a PNG but only 200–500KB as a compressed JPEG.
Lossless PNG Compression
Standard PNG compression uses the DEFLATE algorithm (the same algorithm behind ZIP files). It looks for repeating patterns in the image data and encodes them more efficiently. This process is:
- Completely lossless - the decompressed image is bit-for-bit identical to the original
- Format-native - every PNG file already uses DEFLATE internally
- Limited in reduction - typically 10–30% smaller at best for photographs
Lossless compression works great for simple graphics with large flat-color areas, but struggles with photographic content where pixel patterns are complex and rarely repeat.
Lossy PNG Compression: The Color Quantization Trick
This is where tools like TinyPNG and ZeroPNG shine. Color quantization reduces the number of unique colors in an image - typically from millions (24-bit, ~16.7 million colors) down to 256 or fewer (8-bit palette).
How It Works
- Analyze the image to identify all unique colors used
- Build an optimal palette of N colors (e.g., 256) that best represent the full spectrum
- Map each pixel to its nearest palette color, with optional dithering to smooth transitions
- Encode as 8-bit PNG with the palette embedded in the file
The result? File sizes 60–80% smaller than the original - often with no perceptible quality loss to the human eye.
Why Does It Work So Well?
Most photographs and screenshots use far fewer "visually distinct" colors than the millions available in
24-bit color. A blue sky might use thousands of slightly different blues, but your eye can't tell the
difference between #4A90D9 and #4B91DA. Quantization exploits this by collapsing
near-identical colors into a single representative.
Quality Settings: Finding the Sweet Spot
In ZeroPNG, the quality slider controls how many colors are retained:
| Quality | Colors | Use Case | Typical Reduction |
|---|---|---|---|
| 100% | All (lossless) | Archival, pixel-art | 10–30% |
| 80% | ~204 | Screenshots, UI | 50–70% |
| 60% | ~154 | Web graphics | 65–80% |
| 40% | ~102 | Thumbnails, social | 70–85% |
For most web usage, 70–80% quality produces files that are dramatically smaller with virtually no visible artifacts.
When to Stay Lossless
Not everything should be quantized. Keep lossless compression for:
- Pixel art - where every pixel matters and colors are already limited
- Technical diagrams - where color accuracy is critical
- Source/archival files - when you'll edit the image later
- Images with text overlays - where quantization can cause visible color banding near sharp text edges
Why Browser-Based Compression Matters
Traditional tools like TinyPNG require uploading your images to external servers. ZeroPNG performs the exact same color quantization technique entirely in your browser. Your images never leave your device.
This means:
- Zero privacy risk - no server ever sees your files
- Instant processing - no upload/download latency
- Works offline - compress images even without internet
- No limits - process as many images as your computer can handle