Keep the Quality, Cut the File Size: How Lossless-Looking Compression Works
Why photo files are large, why lossy compression is hard to notice, and how quality settings relate to file size. Learn how the Image app's Keep high quality mode searches for the lowest quality that still scores SSIM 0.985, how PNG optimization works, and how to verify results with the comparison slider.
- Published
- Updated
You try to attach a photo to an email and hit a size limit, or a blog page loads slowly because of a few heavy pictures. The usual worry is that shrinking the file will make the photo look blurry or blocky. The good news is that file size and visible quality are not tied together in a straight line. If you remove the details your eyes barely notice, the file can get much smaller while the picture looks almost the same. This guide explains why, and what the Keep high quality mode in the Image app actually does.
Why photo files are so large
Three things make a photo heavy. The first is pixel count. A 3000 by 2000 photo has six million pixels, and each one carries color information. Many photos are far larger than the size at which they will ever be displayed.
The second is the quality setting your camera used when saving. Phones and cameras tend to save generously, with high quality and large files, in case you edit or print big later. The third is metadata: capture time, device details, and sometimes location are stored inside the file. Metadata is usually a small share of the total, though. Most of the weight comes from the first two.
Why lossy compression is hard to notice
Formats such as JPG and WebP use lossy compression. The name sounds alarming, but the general idea is to discard information that human vision is less sensitive to. Our eyes are quite sensitive to differences in brightness, for example, and relatively less sensitive to very fine differences in color. Tiny noise in smooth areas such as sky or a plain wall is also easy to remove without anyone noticing.
The encoder saves space by describing that kind of detail more roughly. The real question is how much to discard. Remove a little and you cannot see it. Remove too much and you get fuzzy edges or visible bands across a smooth sky. The quality setting is the number that decides where you land.
How the quality number relates to file size
When you move a quality slider up, the file grows, but the relationship is a curve, not a straight line. The exact shape depends on the photo, yet the general pattern holds. Going from low to medium quality brings a big visible improvement. Going through the high range brings almost no visible improvement while the file size climbs steeply.
That is why the maximum setting is not always the best choice. Near the top of the scale there is a point where you spend a lot of bytes on differences nobody can see. Step down a little and the picture looks the same while the file is noticeably smaller. The difficulty is that this point differs from photo to photo. A textured scene and a mostly-sky scene react differently to the same number. So instead of fixing one number, it helps to have a tool that searches for it photo by photo.
What Keep high quality mode does
The Image app offers three ways to reduce a file: Keep high quality, Target size, and Custom settings. Keep high quality is the default, described on screen as reducing with barely visible changes. It works like this.
- It treats quality as a range up to 100, starting at 0 for AVIF and at 60 for JPG and WebP, which it never goes below, and trial-encodes the middle of that range first.
- It decodes the result and checks its similarity to the original with SSIM in two ways. The whole image, on a reduced copy, must score 0.985 or higher, and below quality 85 the six most detailed 128-pixel tiles at full resolution must also score at least 0.965.
- If the result passes, it tries a lower quality. If not, it tries a higher one. Halving the range each time like this is a binary search, and it runs at most seven times.
- It picks the lowest quality that still meets the bar, since lower quality usually means a smaller file.
- If the result would be larger than the original, it keeps the original and shows the note that the file is already small enough.
With the format set to Keep original, a JPG stays a JPG. With Auto, the app compares JPG and WebP, or PNG and WebP when the image has transparency, and chooses the smallest file that meets the same bar. AVIF is slow, so it is left out of the automatic comparison and is only encoded when you choose it yourself. If no quality level can meet the bar, the app tells you the quality threshold was not met, and you can try another format.
SSIM in plain language
SSIM is a score for how similar two images look to a human viewer. Instead of simply counting how different the pixel values are, it compares small regions for brightness, contrast, and structure, meaning the shape of the patterns, and then averages the results. A score of 1 means identical, and the closer to 1, the more alike they are.
The Image app runs the whole-image comparison on a reduced copy whose long side is 512 pixels, because comparing a full 3000-pixel photo would take much longer. A reduced copy alone can miss texture being smeared in a smooth illustration, so the app also picks the few most detailed patches at full resolution, such as hair or lettering, and compares those separately. For images with transparency, the alpha channel is compared as well, so damage to transparent areas is also detected.
PNG and lossless optimization
PNG stores images without loss, so a quality slider does not apply to it. What you can do is store the same pixels more efficiently, which is lossless optimization. For PNG originals the Image app tries OxiPNG first and labels the result as Lossless PNG optimization. No pixel changes, which suits logos, screenshots, and transparent graphics where you do not want a single point altered.
Photos with complex colors are naturally large as PNG, though, and lossless optimization can only shrink them so far. If you need a smaller file, you can change the format itself to JPG or WebP. That makes it lossy, and you need to think about how transparency is handled.
Check it yourself with the comparison slider
Your own eyes are a better judge than any number. The result area shows the original and the result overlaid, and you drag a slider left and right to compare them. Next to it you can see how much smaller the file became, in size and in percent.
- Look at the whole picture first, then zoom in. Differences usually show up first along edges, around text, and in smooth areas such as sky or skin.
- Check fine texture like hair and leaves. If you see smearing, choose another format or raise the quality in Custom settings.
- Judge at the size you will actually use. For a small picture in a blog post, a difference visible only when zoomed in matters little.
- Before downloading, confirm that the size reduction is enough for your purpose.
Saving again and again keeps lowering quality
The key thing to remember about lossy compression is that discarded information cannot be recovered. Each time you save in a lossy format, the file is re-encoded and a little more is discarded. One pass may be invisible, but opening and saving the same file repeatedly lets the errors add up, and quality keeps dropping.
So keep your original somewhere safe and always reduce from the original, once. Rather than shrinking an already-shrunk file, go back to the original and process it again with different settings. When the Image app re-encodes a photo, metadata such as location is not saved. If the result would have been larger and the original was kept as is, the original metadata stays with it.
Here are numbers we re-measured while writing this guide, using a public-domain (CC0) phone photo from Wikimedia Commons: a 3024 by 4032 JPG of 2.76 MB. We ran the same processing code and WebAssembly codecs as the Image app on an Apple M5 Max Mac, and sizes use 1 KB = 1,000 bytes. At the original size, Keep high quality produced a 694.3 KB JPG (quality 60, about 75 percent smaller) in about 8 seconds, and a 463.1 KB WebP (quality 60, about 83 percent smaller) in about 10 seconds. Shrinking the long side to 2000 pixels (1500 by 2000) as well brought the JPG down to 259.8 KB in about 4 seconds. This is a single example. Results and timing vary with the photo, the format, your browser and your device, so treat it as a reference only.
Measured: one image at six quality levels
To see the curve for ourselves, we ran the same WebAssembly encoders that the Image app loads in the browser on a sample image from this site: og-image.png, an illustration of the Mandumon character, 1200×630 and 352.3 KB as PNG. We saved it in JPG, WebP and AVIF at quality 95, 85, 75, 60, 40 and 20, then ran Keep high quality on the same picture. Sizes use 1 KB = 1,000 bytes, as the app does.
- JPG went from 97.9 KB at quality 95 to 46.3 KB at 85 and 31.1 KB at 75. The step from 95 to 85 saved 51.6 KB; the step from 60 to 40 saved only 5.4 KB.
- From 95 down to 75, WebP was the smallest of the three. At 60 and below, AVIF overtook it: 17.5 KB against 17.9 KB at quality 60, and 4.6 KB against 11.0 KB at 20.
- Keep high quality chose JPG quality 71 (28.9 KB), WebP 61 (18.1 KB) and AVIF 44 (10.8 KB). With the format on Auto it returned the WebP file, about 95% smaller than the PNG, because AVIF is left out of the automatic comparison.
- The same mode treated another picture completely differently. A grainy photo of a printed page made for the OCR app's tests (ocr-photo.png, 900×320) needed JPG quality 87 (44.7 KB) to clear the same bar.
- Saving the illustration ten times in a row at JPG quality 75 changed almost nothing after the first save: SSIM stayed at 0.998 and the size settled near 30.6 KB. Alternating between quality 75 and 60 on the document photo was less predictable: 0.951 after the second save, 0.934 after the fifth and 0.951 again after the tenth.

When we first measured this, the same illustration came out at JPG quality 22. At that point the search only looked at the reduced copy, so it missed that the steam and the dumpling skin were visibly smeared at full size. The measurement exposed the problem and it was fixed on 2026-11-22: the full-resolution detail check and the quality floor of 60 for JPG and WebP now give the 71 and 61 above. The numbers are still only a starting point, so for photos that matter, zoom the comparison slider to 100% and look for yourself.
The Image app is a free tool that runs in your browser without sign-up. Photos are processed only on your device and never sent to a server. Add a photo, choose Keep high quality as the reduction method, and check the result with the comparison slider. You can switch to Target size or Custom settings whenever you need to.
