How Image Compression Works Without Ruining Your Photos
A 12-megapixel photo holds 12 million pixels. Stored plainly, with three colour values each, it would take around 36 MB. Your phone keeps it at perhaps 3 MB. So where did the rest go?
Spotting patterns
Pictures repeat themselves. A blue sky is thousands of nearly identical pixels. Instead of storing each one, a compressor can effectively record "this same blue for the next 400 pixels". That is the idea behind lossless compression, which is how PNG works. Nothing is lost, but savings are limited on complex pictures.
Removing what you will not see
Lossy formats such as JPG go further by using facts about human eyes. We notice brightness much more than colour, so colour can be stored at lower detail. We also notice broad shapes more than tiny, fast changes, so fine variation can be simplified.
The quality setting controls how much is simplified. At high settings the change is invisible and the file is already much smaller. This is why a great deal can often be saved with no visible harm.
Why quality falls off a cliff
The relationship is not a straight line. Going from 100% to 85% quality can cut the size by more than half, with no visible change. Going from 40% to 20% saves much less and looks far worse. You will see blocky squares in smooth areas, and halos around sharp edges.
That is why Slimfile will not keep lowering quality forever. Below a certain point, it starts reducing pixel size too, since a slightly smaller, clean picture looks better than a full-size blocky one.
Five habits for better results
- Start from the original. Compressing a compressed image adds damage on top of damage.
- Crop before you compress. Removing what you do not need leaves more room for what you do.
- Match the pixel size to its use. A 6,000-pixel photo on a 1,000-pixel space wastes data.
- Pick the right format. See our guide to JPG, PNG and WebP.
- Check with your eyes. Use a side-by-side comparison and look at faces and text.
Keep your originals
Lossy compression cannot be undone. Once detail is gone, no tool can truly bring it back, whatever some apps may suggest. Treat a compressed copy as just that: a copy for a job. Keep your original somewhere safe for printing or future editing.