Your PNG is Tens of Megabytes. Why, and What Do You Do About It?
You exported an image, and the PNG came back at 40 MB. That is not a bug. PNG is always compressed and always lossless. It cannot discard data. The question is what filled it with incompressible data in the first place. Three things cause a PNG to balloon: the image is a photograph, the canvas is enormous, or the exporter used no compression options. Each has a different fix, and the fixes must happen in order. Resize before you compress. That is the rule.
The exact phrase you need is how to compress a large png. Start by checking which of the three causes fits your file. Then apply the remedy below.
Diagnose Before Treating: the Three Structural Causes
Open the file in any viewer and note its dimensions and content. If the image is a photograph, PNG is working against itself. Photographic sensor noise makes the compression predictor wrong nearly every time, giving small random differences that compress poorly. A photograph as PNG is roughly ten times the size of the same photo as JPEG at a quality difference invisible at normal viewing distance. The fix is to convert to JPEG. Use Preview on macOS, Paint on Windows, or any tool that has a JPEG quality slider. JPEG discards high-frequency detail the eye is poor at noticing. That is the largest saving you can make.
If the canvas is enormous, file size scales with pixel count. Doubling the width quadruples the data. An image displayed at 800 pixels wide and stored at 3000 carries roughly fourteen times the pixel data anyone will see. Resize it. On macOS, Preview: Tools > Adjust Size. On Windows, Paint: Resize on the Home tab (Ctrl+W). For high-density screens, serve about twice the display width, roughly 2560px on the long edge for full screen. A blog image needs about 1600px. Resize before compressing. Compressing pixels you are about to discard is wasted work, and the compressor performs better on the smaller image.
If the exporter was careless, the file may contain a 16 bit per channel export, Adam7 interlacing, or metadata chunks that can be stripped losslessly. A 16 bit export is twice the data of 8 bit and invisible on screen. Adam7 interlacing makes a PNG progressively load but increases its size. Metadata chunks such as tEXt, iTXt, eXIf, and iCCP colour profiles can be stripped without affecting the pixels. Use a lossless optimizer like optipng or zopflipng, or bundle them in ImageOptim on macOS. Typical saving is 5 to 15 per cent, sometimes zero on an already optimized file.
How to Compress a PNG File Size When the Image Is a Photograph
For a photograph, the honest answer is to change format. PNG promises exact pixels and cannot discard the high frequency sensor noise that JPEG handles by design. On Windows, open in Paint and Save as JPEG. On macOS, Preview: File > Export and pick JPEG. A quality slider appears. Set it between 75 and 85. The file will drop from tens of megabytes to a few hundred kilobytes with no visible difference at normal viewing distance. If you must keep PNG, palette reduction will force a 40 to 70 per cent saving, but banding may appear in the sky or other smooth areas. Keep the original for print or archival use.
How to Compress Large PNG Files by Reducing Dimensions
Resizing is the single highest impact action you can take. File size scales with pixel count, so cutting dimensions in half reduces the pixel count by a factor of four. On macOS, use Preview: Tools > Adjust Size. On Windows, Paint: Resize (Ctrl+W). A blog image needs about 1600px on the long edge. A full screen hero image needs about 2560px. Do not guess. Measure the display space and match it. Then export. This step alone can turn a 40 MB file into a 5 MB file. Always resize before compressing. Compressing the larger version first wastes time and gives a worse result.
Reduce Large PNG File With Palette Reduction
Palette reduction rebuilds the image from an adaptive palette of typically 256, 128, or 64 colours chosen from the colours actually present. Each pixel needs 7 or 8 bits instead of 24 or 32. Thousands of near identical shades collapse into one entry, creating exactly the repetition DEFLATE feeds on. The tool is pngquant on the command line, or the built in functions in Photoshop and GIMP. In Photoshop, File > Export > Export As and tick Smaller File (8 bit). That switches to a 256 colour indexed palette. For finer control, File > Export > Save for Web (Legacy) gives a Colors dropdown from 2 to 256 and a Dither slider. In GIMP, Image > Mode > Indexed, choose Generate optimum palette, set the maximum number of colours, then export via File > Export As with a .png filename. The visible failure mode is banding in smooth gradients. A gentler setting with more colours fixes it. Palette reduction cannot be undone. Keep the original and compress a copy.
Lossless Optimisation vs Lossy Reduction: What Each Can Do
Lossless optimisation searches harder for the best filter per row, reruns DEFLATE at maximum effort, and strips metadata chunks. The decoded pixels are identical. Typical saving is 5 to 15 per cent, and 0 to 5 per cent for a photograph. Re encoding can produce a larger file than the original; a correct tool returns the original in that case. Use optipng or zopflipng for this. On macOS, ImageOptim bundles several lossless optimizers.
Lossy reduction uses palette reduction or format conversion. Typical savings for a screenshot are 70 to 85 per cent. For a photograph stored as PNG, 40 to 70 per cent is common. For an already optimized PNG, 0 per cent. The tradeoff is visible quality loss in gradients and semi transparent edges. The second failure mode is a stair step fringe on semi transparent edges: the soft alpha band around a rounded logo needs enough palette entries or it snaps into discrete steps. A gentler setting fixes it.
The Real Savings Are in Indexed Mode
If your image is a screenshot, logo, chart, or illustration, palette reduction is where the file size drops from megabytes to tens of kilobytes. A UI screenshot with 256 colours drops 70 to 85 per cent. A logo or icon drops 60 to 80 per cent. A chart or diagram drops 70 to 80 per cent. Even an illustration with gradients drops 40 to 65 per cent. Those numbers are not available from lossless optimisation alone.
Photoshop users: File > Export > Save for Web (Legacy). Set PNG 8, choose a colour count between 64 and 256, and watch the live file size readout. GIMP users: Image > Mode > Indexed, generate optimum palette, and export. Command line users: pngquant. The tool chooses the best palette for the image. Do not go below 64 colours unless the image is very simple. Banding becomes visible at 32 or below. For semi transparent edges, keep 128 or 256 colours. That is the point where the image still looks perfect and the file is tiny.
Typical Savings by Method and Image Type
| Image Type | Lossless Only | Palette Reduction | Format Conversion (JPEG) |
|---|---|---|---|
| UI Screenshot | 5 to 15% | 70 to 85% | Not suitable sharp edges |
| Logo / Icon | 5 to 15% | 60 to 80% | Not suitable ringing artifacts |
| Chart / Diagram | 5 to 15% | 70 to 80% | Not suitable |
| Illustration with gradients | 5 to 15% | 40 to 65% | Not suitable banding |
| Photograph | 0 to 5% | 40 to 70% | 90 to 95% |
Preserve the Lossless Original Before Palette Compression
Do palette reduction only once. Compressing an already palette reduced file again gives a worse result than going to the low colour count once, because the second pass chooses from an already impoverished set. Lossless re compression is safe to repeat. Keep the original file. Palette reduction cannot be undone.
Print resolution is far higher than screen and exposes banding invisible on a monitor. Send print the untouched original. For web use, declare width and height on the image tag to prevent the layout shift measured by Cumulative Layout Shift. Images are typically 50 to 70 per cent of a web page total weight. The hero image is usually the most effective thing to shrink. Apply the order: strip metadata losslessly, then reduce the palette in steps, then reduce dimensions, then change format. That is the cheapest order.
On macOS, Preview has no PNG quality slider. The real saving in Preview comes from scaling dimensions, not from export options. On Windows, Paint has no compression setting for PNG. The saving there is resizing or converting to JPEG. Photoshop and GIMP give you palette reduction. Use them. The command line tools pngquant, optipng, and ImageMagick can automate the whole pipeline.
Format Comparison: When to Switch
PNG is the best choice for sharp edges, flat colour, text, and transparency. JPEG is the best choice for photographs. WebP supports a full alpha channel like PNG and is about 26 per cent smaller lossless. It is supported by all current browsers. Some older desktop applications still cannot open it. JPEG has no alpha channel. Converting a transparent PNG to JPEG flattens transparency onto a solid colour, usually white. JPEG handles sharp edges badly, producing visible ringing around text and lines, and on flat artwork often produces a larger file than PNG. Choose the format that fits the content. For a photograph, use JPEG. For everything else, use PNG with palette reduction.