How to compress PNGs (and when not to use them)
PNG is the format for logos, icons, screenshots, and anything that needs a transparent background. It works very differently from JPEG, and using it well starts with knowing what it's actually good at.
First, make sure you actually want PNG
This is the most useful thing I can tell you about PNG, so I'm putting it first: PNG is the right choice for logos, icons, screenshots, line art, and anything that needs a transparent background. It is the wrong choice for photographs.
PNG is lossless — it keeps every single pixel exactly as it was. That's perfect for a logo with crisp edges, but it's a disaster for a photo of a person, because there's no "close enough" it's allowed to settle for. Save a holiday photo as PNG and you'll get a file five to ten times larger than the same photo as a JPEG that looks identical. If your image is a photograph, stop here and use JPEG instead.
How you actually shrink a PNG
Because PNG won't throw away detail, you can't just slide a quality dial like you can with JPEG. The savings come from a different trick: reducing the number of colors.
A full-colour PNG (called PNG-24) can store millions of colors. But most logos and icons use maybe a few dozen. If your image genuinely only needs 256 colors or fewer, converting it to an indexed palette (PNG-8) can cut the file by half or more with literally zero visible change — the pixels that remain are pixel-for-pixel identical. That's the single biggest lever for PNG, and it's why a good optimizer can make logos so much smaller than the file your design tool exported.
Transparency survives — that's the whole point
The reason most people choose PNG in the first place is the transparent background, and a lot of compressors quietly wreck it or flatten it to white. Compressing here keeps the alpha channel intact, so a logo you drop onto a coloured header still sits cleanly on top of it afterwards. If transparency is why you're using PNG, that's the thing you don't want to lose.
A few habits that keep PNGs lean
- Crop the empty space. Transparent pixels around your icon still cost bytes. Trim tight to the artwork.
- Don't export at 3× the size you'll show. A 1000px logo displayed at 200px is mostly wasted file. Resize first.
- Drop the metadata. Design tools love to embed colour profiles and editing history you don't need on the web.
- Reach for SVG when you can. For a flat logo or icon, a vector SVG is often a fraction of the size and stays sharp at any zoom. PNG is for when SVG isn't an option.
Quick gut check
Is your image a photo? Use JPEG. Is it a logo, icon, screenshot, or does it need a transparent background? PNG is right — and reducing its color count is where the savings come from.
Written by
Sanjay Sahani — Solution Architect
Sanjay Sahani is a solution architect with 21+ years building software. He created InstaShrink after one too many projects where “just compress the images” meant uploading client photos to a server he didn't control — so this tool does all its work inside your browser instead.
More about InstaShrink →