How to Compress PNG Files Without Losing Quality
By the FreeAssetHub team · October 28, 2026 · 5 min read
PNG images are sharp and support transparency, but they can be large. A single 4000-pixel cut-out can weigh several megabytes, and a few of them can slow down a web page noticeably. The good news is that you can often shrink PNGs a lot with little or no visible change.
Why PNG files get big
PNG stores every pixel exactly, plus an alpha channel for transparency. Photographs and images with soft gradients contain many unique colours, so the compressor has less repeated information to remove. Simple graphics with flat colours compress much better.
Step 1: Resize first
The biggest saving comes from using the right dimensions. If an image is displayed 800 pixels wide on your page, there is no benefit in serving a 4000-pixel file. Resize to the largest size it will actually be shown at, and include a version at twice that width only if you need sharp rendering on high-density screens.
Step 2: Choose lossless or lossy
- Lossless optimisation rewrites the file more efficiently without changing a single pixel. Tools such as oxipng or OptiPNG reduce size safely, though savings are modest.
- Lossy (palette) compression reduces the number of colours, for example from millions to 256, with dithering to hide the change. Tools such as pngquant or TinyPNG use this approach and can cut size dramatically. For logos, icons and illustrations the difference is usually invisible. For detailed photos or smooth gradients, check the result carefully because banding can appear.
Free tools to try
- Squoosh (in the browser): compare before and after side by side and control the settings.
- TinyPNG (in the browser): simple drag and drop, quantisation-based.
- pngquant and oxipng (command line): ideal for processing many files at once.
- Your design tool's export: Photoshop, Figma and Affinity can export optimised PNGs.
Step 3: Consider another format
If the image does not need to remain a PNG, WebP and AVIF can keep transparency with much smaller files. For photographs without transparency, JPG or WebP is usually the better choice. You can compare formats in our guide to PNG, JPG and SVG.
Step 4: Always compare visually
Zoom in to 200 percent and look at edges, shadows and gradients. Check the image on both a light and a dark background, because poorly compressed transparent edges can show a faint halo on one of them. If you see problems, raise the quality setting or use lossless mode.
Quick checklist
- Resize to the displayed size
- Choose lossless for photos and critical work, lossy for flat graphics
- Compare against the original
- Keep an untouched master copy
Always keep the original file. Compressed copies are for publishing; the master is for editing. If you need clean, transparent source files to start from, browse the PNG collection.