Skip to content
← All posts/
pngAugust 2, 2026 Β· 4 min read

How to compress PNG files without losing transparency

PNG compression techniques that reduce file size while preserving the alpha channel for transparent images.

M

Motionix

Practical guides with sources and explicit limitations.

Close view of hands using a laptop
Burst / Pexels
Jump to

PNG files with transparency are often larger than they need to be. Here's how to shrink them without losing the transparency that makes them useful.

Why PNGs are large

PNG uses lossless compression β€” every pixel is preserved exactly. For photographs, this means file sizes 5-10x larger than JPEG. For screenshots and graphics with flat colors, PNG is actually efficient.

The transparency (alpha channel) adds 25% to the file size because it stores an extra value for every pixel.

Compression techniques

1. Remove unnecessary metadata

PNG files can contain EXIF data, color profiles, and text chunks. Removing these saves 5-15% without affecting the image.

2. Reduce color depth

If your image doesn't need 16 million colors, use a palette:

  • 8-bit palette (256 colors): Great for logos, icons, simple graphics
  • 24-bit: Standard for photographs (no transparency)
  • 32-bit: 24-bit + 8-bit alpha channel (transparency)

3. Optimize the alpha channel

If parts of your image are fully opaque, you can set the alpha channel to 100% in those areas. Some encoders store unnecessary transparency data.

4. Use PNG optimization tools

Tools like pngquant, OptiPNG, and zopflipng can reduce PNG size by 20-50% losslessly.

When to use WebP instead

WebP supports transparency with both lossy and lossless compression:

  • Lossy WebP with alpha: 50-70% smaller than PNG
  • Lossless WebP: 20-30% smaller than PNG

Browser support for WebP transparency is 97% in 2026.

Workflow for transparent images

  1. Create the image with transparency as needed.
  2. Export as PNG from your editor.
  3. Optimize the PNG with a compression tool.
  4. Consider WebP if the file is still too large and browser support is acceptable.

Common mistakes

  • Converting JPEG to PNG. You don't gain transparency β€” just a larger file.
  • Using 32-bit PNG for non-transparent images. Use 24-bit if you don't need transparency.
  • Over-compressing. Lossy PNG compression can create visible banding in gradients.

PNG-8 vs PNG-24 vs PNG-32: choosing bit depth

The single biggest lever on PNG size is bit depth. Match it to the content:

TypeColorsTransparencyBest forTypical size
PNG-8Up to 256 (palette)1-bit or indexed alphaLogos, icons, flat UI, simple illustrationsSmallest
PNG-2416.7 millionNonePhotographic content without transparencyLarge
PNG-3216.7 millionFull 8-bit alphaPhotos or gradients that need soft transparencyLargest

Most "heavy" transparent PNGs are 32-bit images that could be 8-bit. A flat logo with a transparent background rarely needs more than 256 colors, and PNG-8 with indexed alpha can cut its size by 60-80% with no visible change.

How quantization preserves transparency

Quantization maps millions of colors down to a small palette. Done well, it keeps transparency clean; done carelessly, it leaves ugly edges:

  • Indexed alpha vs binary alpha. Binary alpha makes each pixel fully opaque or fully transparent, producing jagged edges. Indexed/variable alpha keeps partial transparency for smooth anti-aliased edges.
  • Edge fringing. If transparent areas were exported over a white background, semi-transparent edge pixels keep a white halo. Export over a matte that matches your final background, or use a tool that preserves premultiplied alpha.
  • Dithering. Light dithering hides banding when reducing colors, at a small size cost. Turn it off for flat graphics, on for subtle gradients.

Tools like Image Compressor apply these steps automatically, but knowing what they do helps you spot when an export went wrong.

Keep PNG or switch to WebP?

Use this quick test:

  1. Is it a flat graphic (logo, icon, UI)? Keep PNG-8 β€” it is already tiny and universally supported.
  2. Is it a photographic image with soft transparency? Try lossy WebP with alpha; it is usually 50-70% smaller than PNG-32.
  3. Do you need a transparent cutout at all? If you are removing a background to make the PNG, Background Remover produces a clean alpha channel to start from.

For creating transparent images from scratch, see how to make a transparent PNG. To compare PNG against every modern format side by side, read JPG vs PNG vs WebP vs AVIF.

Frequently Asked Questions

Does compressing a PNG remove its transparency?

No, if you use a PNG-aware tool. Proper PNG optimization keeps the alpha channel intact. Transparency is only lost if you flatten the image or convert to a format without alpha, such as JPEG.

Why is my transparent PNG so much bigger than a JPEG?

PNG is lossless and stores an extra alpha value per pixel, so photographic PNGs are often 5-10x larger than the same photo as JPEG. JPEG cannot store transparency at all, which is why PNG stays larger for cutouts.

Is PNG-8 always smaller than PNG-24?

Yes, because it stores at most 256 colors instead of 16.7 million. The trade-off is color accuracy, so PNG-8 is ideal for flat graphics but poor for photographs.

Can WebP fully replace PNG for transparency?

For the web, largely yes β€” WebP supports full alpha and is smaller. Keep a PNG copy when you need maximum compatibility with older software or email clients that don't render WebP.

Share

Keep reading

Conversation

Join the conversation

Share a useful question, correction, or practical tip. Comments are reviewed before they appear.

Loading…

Motionix

A focused tool for your next step

Choose the right task and check its formats, processing and limits before starting.

Open tools