How to Reduce PNG File Size (Lossless vs Lossy)
Practical techniques to shrink your PNGs without ruining quality
Optimize PNGs NowPNG is one of the most trusted image formats on the web. It preserves every pixel, supports transparency, and renders logos, screenshots, and graphics with razor-sharp clarity. But that quality comes at a cost: PNG files can be enormous. A single high-resolution screenshot can easily reach 5 MB or more, and a batch of product images with transparent backgrounds can consume dozens of megabytes.
Large PNGs slow down websites, bloat email attachments, eat into storage, and frustrate users on slower connections. The good news is that you can dramatically reduce PNG file sizes without switching formats or sacrificing the qualities that made you choose PNG in the first place. The key is knowing which techniques to apply and in what order.
This guide walks through every practical method for shrinking PNGs, from lossless optimization that preserves every pixel to lossy compression that trades minor visual fidelity for major size savings. By the end, you will know exactly which approach to use for any situation.
Why Do PNG Files Get So Large?
Understanding why PNGs balloon in size helps you choose the right reduction strategy. Several factors contribute to the problem.
Lossless compression has limits. PNG uses the DEFLATE algorithm, which finds repeated patterns in pixel data and encodes them efficiently. But photographs and images with smooth gradients contain so many unique color values that the compressor struggles to find redundancies. A photograph saved as PNG can be five to ten times larger than the same image saved as JPG, because DEFLATE simply cannot compress photographic data as aggressively as lossy algorithms can.
Dimensions matter more than you think. A 4000 x 3000 pixel image contains 12 million pixels. Each pixel in a 32-bit PNG with transparency requires 4 bytes of raw data before compression, so the uncompressed payload is roughly 48 MB. Even with DEFLATE, the resulting file will be many megabytes. Cutting the dimensions in half reduces the pixel count by 75 percent, and the compressed file size drops roughly in proportion.
Color depth adds weight. A 24-bit PNG stores over 16 million possible colors per pixel. A 32-bit PNG adds an alpha channel for transparency, increasing data per pixel by a third. Many images, especially icons, diagrams, and illustrations, use only a handful of colors and carry far more color information than they need.
Metadata inflates files silently. EXIF data, ICC color profiles, text chunks, and timestamps can add tens of kilobytes to a PNG file. For small images like icons and thumbnails, metadata can represent a significant percentage of the total file size. Learn more about metadata in images in our guide to removing image metadata.
Lossless Ways to Shrink PNG Files
Lossless techniques reduce file size while keeping the image pixel-perfect. Every color, every edge, every transparent area remains exactly as it was. These methods should always be your first line of attack.
Optimize the DEFLATE compression. Not all PNG encoders compress equally well. A quickly exported PNG from a graphics editor often uses a fast but suboptimal DEFLATE configuration. Re-encoding the same image with a more thorough compressor can shave 10 to 30 percent off the file size without changing a single pixel. pic2PNG uses the @jsquash/png WASM library to apply optimized lossless compression when you convert or re-export your images, squeezing out every byte the DEFLATE algorithm can save.
Strip unnecessary metadata. Remove EXIF data, ICC color profiles, text comments, and timestamps that add bulk without contributing to the visible image. This is especially important for images originally captured by cameras or phones, which embed GPS coordinates, device information, and camera settings. pic2PNG automatically strips metadata during conversion, ensuring your output files are lean and privacy-friendly.
Reduce dimensions. Resize your image to the actual size it will be displayed at. There is no benefit to serving a 4000-pixel-wide PNG when the container is only 1200 pixels wide. Use pic2PNG to resize images in batch before export, and you will see dramatic file size drops without any quality loss at the display size.
Crop to content. If your image has large empty or uniform areas around the edges, cropping to the actual content area removes pixels that add file size but provide no visual value. pic2PNG includes cropping tools that let you trim images to exactly the dimensions you need.
Lossy PNG Compression: When and How
Sometimes lossless optimization is not enough. When you need to hit a target file size or your PNG is a photograph that simply does not compress well losslessly, lossy PNG compression becomes a powerful option.
How it works. Lossy PNG compression reduces the number of distinct colors in the image and approximates pixel values to create more redundancy for the DEFLATE compressor to exploit. The image remains a valid PNG file with full transparency support, but subtle color variations are smoothed or merged. The result can be 50 to 80 percent smaller than the lossless original while looking virtually identical to the human eye.
Quality levels. Most lossy PNG tools let you set a quality level, typically on a scale of 0 to 100. At 80 to 90, the differences from the original are imperceptible for most images. At 60 to 80, trained eyes might notice slight banding in gradients or reduced detail in textures. Below 60, artifacts become more visible and are best reserved for thumbnails or preview images. pic2PNG provides an optional lossy compression step powered by browser-image-compression that lets you dial in the exact quality level for your needs.
When to use lossy. Lossy PNG compression shines for web images where page speed matters, for images with many colors or photographic content, and for situations where you need PNG transparency but cannot afford multi-megabyte files. It is also useful when batch processing large numbers of images where even a 40 percent reduction per file translates to meaningful bandwidth and storage savings.
When to avoid lossy. Do not apply lossy compression to pixel art, technical diagrams with precise color coding, or images that will be further edited or composited. Each round of lossy compression introduces cumulative degradation. If you plan to make additional edits, keep a lossless master copy and only apply lossy compression to the final export.
PNG Size Reduction Techniques at a Glance
The following table summarizes each technique, whether it preserves the original image perfectly, and the typical file size impact you can expect.
| Technique | Lossless? | Keeps Transparency? | Typical Impact |
|---|---|---|---|
| Optimize DEFLATE compression | Yes | Yes | 10-30% reduction |
| Strip metadata (EXIF, ICC, text) | Yes | Yes | 5-20% reduction (varies) |
| Resize to display dimensions | Yes (at new size) | Yes | 50-90% reduction |
| Crop to content area | Yes (at new size) | Yes | 10-60% reduction |
| Reduce color palette | No | Yes | 30-70% reduction |
| Lossy quality compression | No | Yes | 40-80% reduction |
| Switch to JPG (photos) | No | No | 60-90% reduction |
| Switch to WebP | Both options | Yes | 25-50% reduction |
These techniques are most effective when combined in the right order. Start with resizing, then apply lossless optimization and strip metadata, then add lossy compression only if the file is still too large.
Sometimes You Should Not Use PNG
The best way to reduce a PNG file size is sometimes to stop using PNG altogether. The format excels at certain types of images but is a poor fit for others.
Photographs belong in JPG. If your image is a photograph without any transparent areas, JPG will produce a file that is 60 to 90 percent smaller than the equivalent PNG at quality levels where the difference is invisible. PNG was never designed for photographic content, and its lossless compression cannot compete with JPG's purpose-built lossy algorithm for this type of image.
WebP offers the best of both worlds. If your target audience uses modern browsers, WebP delivers smaller files than both PNG and JPG while supporting transparency and both lossy and lossless modes. A lossless WebP is typically 25 percent smaller than a lossless PNG. For a detailed comparison, read our PNG vs JPG vs WebP guide.
Keep PNG for what it does best. PNG remains the right choice for logos, icons, screenshots, graphics with text, and any image that requires transparency with pixel-perfect precision. When transparency is essential and the image has relatively few colors or large areas of uniform color, PNG compression works efficiently and file sizes stay reasonable.
The key question to ask is: does this image require transparency or lossless quality? If yes, optimize the PNG using the techniques above. If no, consider whether JPG or WebP would serve you better. For more detail on the core format, see our article on what PNG is and how it works.
The Optimal PNG Reduction Workflow
Putting it all together, here is the recommended step-by-step approach to reducing PNG file sizes efficiently:
- Resize first. Scale the image to the actual dimensions you need. This is the single biggest lever for file size reduction. Use pic2PNG to resize in batch.
- Crop to content. Remove any unnecessary empty space around the edges of the image.
- Apply lossless optimization. Re-encode the PNG with optimized DEFLATE compression. pic2PNG handles this automatically using the @jsquash/png WASM library.
- Strip metadata. Remove EXIF data, ICC profiles, and text chunks. pic2PNG strips metadata by default during conversion.
- Apply lossy compression if acceptable. If the file is still too large and minor quality loss is tolerable, enable lossy compression and set a quality level of 80 or higher for most use cases.
- Consider switching formats. If the image is a photograph without transparency, export as JPG instead. If the image targets modern browsers, consider WebP for even smaller files.
This order matters. Resizing before optimizing ensures the compressor works on fewer pixels. Stripping metadata before lossy compression avoids wasting quality budget on non-visible data. And evaluating format alternatives last means you have already done everything possible within the PNG format before making a change.
With pic2PNG, you can handle every step of this workflow in a single session: resize, crop, optimize, strip metadata, and export, all directly in your browser with no uploads, no sign-ups, and complete privacy. Try it with your next batch of PNGs and see the difference for yourself.