How to Compress PNG Files: Reduce Size Without Losing Quality
Learn how to compress PNG files to reduce size without sacrificing image quality. Covers lossless and lossy techniques, batch compression, and optimization for web, email, and storage.
Sarah Chen·February 19, 2026·11 min read
Why PNG Files Are So Large
PNG (Portable Network Graphics) is a lossless image format -- it preserves every pixel exactly as created, with no compression artifacts. This makes PNG ideal for screenshots, graphics with text, logos, diagrams, and any image where sharp edges and exact color reproduction matter. But this fidelity comes at a cost: file size.
A single high-resolution PNG screenshot can easily reach 5-15 MB. A set of product photos saved as PNG might consume hundreds of megabytes. Website pages loaded with unoptimized PNGs take seconds to load instead of milliseconds, hurting both user experience and SEO rankings.
The good news is that PNG files almost always contain significant optimization potential. Most PNGs can be reduced by 30-80% without any visible quality loss using the right compression techniques. This guide covers every method, from quick online tools to advanced optimization strategies.
Comparison showing original PNG file size versus compressed PNG with no visible difference
Stage 1: Filtering -- Before compression, PNG applies a predictive filter to each row of pixels. The filter predicts each pixel's value based on neighboring pixels and stores only the difference. For images with smooth gradients or repeating patterns, the differences are small numbers (often zeros), which compress extremely well.
There are five filter types (None, Sub, Up, Average, Paeth), and the optimal filter can differ for each row. Choosing the best filter strategy is one of the key optimization decisions.
Stage 2: DEFLATE compression -- The filtered data is compressed using DEFLATE (the same algorithm used in ZIP files). DEFLATE finds repeated byte patterns and replaces them with shorter references. The compression level (1-9) controls how hard the algorithm searches for patterns -- higher levels find more patterns but take longer.
Lossless vs Lossy PNG Compression
Lossless compression reduces file size without changing a single pixel. The decompressed image is bit-for-bit identical to the original. This is what standard PNG compression does, and optimized tools can squeeze more efficiency from the DEFLATE stage.
Lossy PNG compression selectively reduces the number of colors in the image (color quantization) before applying lossless compression. A 24-bit PNG with 16 million possible colors might be reduced to an 8-bit palette of 256 carefully chosen colors. If the original image uses relatively few colors (as most screenshots and graphics do), the visual difference is imperceptible -- but the file size drops dramatically.
Compression Type
Typical Reduction
Quality Impact
Best For
Lossless (optimized DEFLATE)
10-30%
None (bit-for-bit identical)
Medical imaging, archival, precision graphics
Lossless (Zopfli/ZopfliPNG)
15-40%
None
Web assets, icons, sprites
Lossy (256 colors)
60-80%
Minimal (barely visible)
Screenshots, UI graphics, charts
Lossy (64-128 colors)
70-90%
Noticeable on gradients
Thumbnails, simple graphics, icons
Pro Tip: For most use cases, lossy PNG compression with 256 colors provides the best results. The human eye struggles to distinguish between 256 well-chosen colors and 16 million in typical web graphics. Test with your specific images -- you may find that even 128 colors produces indistinguishable results at 75% smaller file sizes.
Method 1: Compress PNGs Online
The fastest way to compress PNG files is with an online tool that requires no installation.
Using ConvertIntoMP4's PNG Compressor
Our PNG compressor processes files directly in your browser:
Upload your PNG -- Drag and drop one or multiple PNG files into the upload area
Choose compression level -- Select from preset options (Light, Medium, Strong) or set a custom target
Preview the result -- Compare the original and compressed versions side by side
Download -- Get your compressed PNG files individually or as a ZIP archive
The tool automatically selects the optimal compression strategy based on your image content. Graphics with few colors get aggressive palette reduction. Photos get optimized DEFLATE with smart filtering.
For JPEG images, our JPEG compressor uses different algorithms optimized for photographic content. And if you need to compress multiple image formats at once, our image compressor handles PNG, JPEG, WebP, and more in a single batch.
Method 2: Command-Line Tools
For developers, designers, and power users who need programmatic compression or integration into build pipelines, command-line tools offer the most control.
pngquant (Lossy)
pngquant is the gold standard for lossy PNG compression. It reduces 24/32-bit PNGs to 8-bit palettized PNGs using a median-cut color quantization algorithm with Floyd-Steinberg dithering.
# Basic compression (auto quality)
pngquant image.png --output compressed.png
# Set quality range (min-max)
pngquant --quality=65-80 image.png -o compressed.png
# Batch compress all PNGs in a directory
pngquant --quality=65-80 --ext=.png --force *.png
OptiPNG (Lossless)
OptiPNG recompresses PNGs using optimal filter and DEFLATE settings without changing any pixel data.
# Optimize with maximum compression
optipng -o7 image.png
# Batch optimize
optipng -o5 *.png
Zopfli/ZopfliPNG (Lossless, Maximum)
Google's Zopfli algorithm produces DEFLATE-compatible output that is 3-8% smaller than standard DEFLATE. The tradeoff is dramatically slower compression (100x slower), but decompression is standard speed.
zopflipng --iterations=15 input.png output.png
Combining Tools for Maximum Compression
The ultimate compression pipeline combines lossy color reduction with optimized lossless compression:
This two-step approach typically achieves 70-85% reduction for web graphics.
Method 3: Desktop Applications
Adobe Photoshop
Open your PNG file
Go to File > Export > Export As (or Save for Web for legacy)
Select PNG format
Uncheck Transparency if not needed (saves 25% of data)
Reduce the image dimensions if the original is larger than needed
Click Export
Photoshop's "Smaller File" preset applies moderate lossy compression. For maximum control, use the legacy "Save for Web" dialog which shows file size in real time as you adjust settings.
GIMP (Free)
Open your PNG file
If the image has many colors, use Image > Mode > Indexed to reduce the palette
Go to File > Export As and choose PNG
Set compression level to 9 (maximum lossless)
Uncheck "Save background color" and other unnecessary metadata
Click Export
Step-by-step screenshots of PNG compression in an image editor
Optimization Strategies by Image Type
Different types of PNG images respond differently to compression techniques. Using the right strategy for each type maximizes savings.
Image Type
Typical Original Size
Best Strategy
Expected Reduction
Notes
Screenshots (desktop)
2-10 MB
Lossy (256 colors)
70-85%
Most UI elements use limited colors
Icons and logos
10-500 KB
Lossless (OptiPNG)
15-40%
Few colors; already efficient
Charts and diagrams
100 KB-2 MB
Lossy (128-256 colors)
60-80%
Flat colors compress extremely well
Photographs (saved as PNG)
5-30 MB
Convert to JPEG instead
80-95%
PNG is wrong format for photos
Graphics with transparency
100 KB-5 MB
Lossy (256 colors + alpha)
50-75%
Alpha channel adds ~25% data
Pixel art
10-200 KB
Lossless (indexed color)
30-60%
Never use lossy — artifacts destroy crisp pixels
Text-heavy graphics
200 KB-3 MB
Lossy (256 colors)
65-80%
Dithering around text edges is negligible
Pro Tip: If you have photographs saved as PNG (a common mistake when using screenshots or screen captures of photos), the best "compression" is to convert them to JPEG. A 15 MB PNG photo becomes a 1-2 MB JPEG at quality 85 with virtually no visible difference. Our image compressor detects photographic content and can recommend the optimal format automatically. For detailed format selection guidance, read PNG vs JPG: when to use each.
Reducing PNG Size Before Compression
Compression works on the data you give it. Reducing the data before compression amplifies the savings.
Remove Unnecessary Metadata
PNG files can contain chunks of metadata: text comments, creation software info, timestamps, color profiles, and even thumbnails. Stripping these saves a few KB per file, which adds up in bulk.
# Remove all non-essential chunks with pngstrip or exiftool
exiftool -all= image.png
Resize to Actual Display Dimensions
A 4000x3000 PNG displayed at 800x600 on a webpage contains 25x more pixel data than necessary. Resize before compressing:
Our image resize tool lets you set exact dimensions or scale by percentage while preserving transparency and color profiles. Resizing from 4000x3000 to 800x600 reduces the raw pixel count from 12 million to 480,000 -- a 96% reduction before any compression algorithm even runs.
Remove Alpha Channel If Unused
Many PNG files include an alpha (transparency) channel even when every pixel is fully opaque. The alpha channel adds approximately 25% to the file size. If your image does not need transparency, flatten it onto a solid background and save as RGB (24-bit) instead of RGBA (32-bit).
Diagram showing PNG compression pipeline from original through optimization steps to final compressed file
PNG Compression for Web Performance
Website performance depends heavily on image optimization. Google's Core Web Vitals explicitly measure how fast the largest visual element loads (Largest Contentful Paint), and unoptimized PNGs are a top offender.
Web Optimization Checklist
Resize to display dimensions -- Never serve a 2000px image in an 800px container
Compress with lossy quantization -- 256-color PNGs are sufficient for most UI elements
Consider modern formats -- WebP and AVIF offer 30-50% smaller files than optimized PNG for equivalent quality
Use responsive images -- Serve different sizes for different screen widths via srcset
Lazy load below-the-fold images -- Only load images when they scroll into view
Enable HTTP compression -- Gzip/Brotli on the server provides another 5-10% on PNG files
For web delivery, modern formats offer compelling advantages over PNG:
WebP -- 26% smaller than PNG (lossless) with support in all modern browsers
AVIF -- Up to 50% smaller than PNG with wider color gamut and HDR support
JPEG XL -- Up to 35% smaller with progressive decoding (browser support still limited)
However, PNG remains the right choice when you need guaranteed compatibility (email, documents, legacy systems), transparency with maximum quality (WebP lossy transparency can show artifacts), or pixel-perfect reproduction for archival purposes.
Batch Processing Workflows
For Web Developers (Build Pipeline)
Integrate PNG compression into your build process:
When exporting assets from Figma, Sketch, or Adobe XD:
Export at 1x, 2x, and 3x resolutions
Run all exported PNGs through our PNG compressor in a single batch
The compressed files replace the originals with optimized versions
For Content Teams (CMS Uploads)
Before uploading images to your CMS (WordPress, Shopify, Squarespace):
Resize images to the maximum display width of your content area
Compress using our online tool
Upload the optimized files
Verify the images look correct on the published page
For related image workflow topics, explore our guide on batch processing files. And if you need to combine multiple compressed PNGs into a single document, our images to PDF tool assembles them while preserving quality.
Common Mistakes to Avoid
Using PNG for photographs -- PNG is designed for graphics, not photos. Converting photos from JPEG to PNG for "better quality" actually wastes space without improving visible quality. Keep photos as JPEG (or AVIF/WebP for web).
Over-compressing with too few colors -- While 256 colors works for most graphics, images with complex gradients (sunset skies, skin tones, blurred backgrounds) may show visible banding. Test before deploying.
Compressing already-compressed PNGs -- Running an already-optimized PNG through compression again wastes time and produces negligible savings. Check if the file has already been processed.
Ignoring image dimensions -- Compression cannot compensate for serving a 5000px image in a 500px container. Resize first, then compress.
Forgetting retina displays -- For web, export at 2x the display size for retina/HiDPI screens, then let the browser scale down. A 1600px image displayed at 800px CSS width looks sharp on retina while allowing the browser to optimize rendering.
PNG compression is one of the highest-impact optimizations you can make for web performance, email efficiency, and storage management. Whether you use our online PNG compressor, command-line tools, or build-pipeline integration, the techniques in this guide will dramatically reduce your PNG file sizes while preserving the visual quality that made you choose PNG in the first place.