Can you compress an image without losing quality?
Updated
Yes. Visually lossless compression removes only the detail your eye cannot see, so the file gets much smaller while the picture looks the same. Here is what that means in numbers, measured on a real photo.
The short answer
Most images can lose half of their weight or more without any difference you could notice at normal size. The trick is to remove information that carries no visible meaning: faint sensor noise, colour precision beyond what a screen shows, and redundancy in how the file is stored. What you cannot do is shrink a file to any size you like and keep every pixel identical. Past a certain point, something visible has to go.
So the honest question is not whether compression changes the file, it always does, but whether the change can be seen. A good compressor checks that for you instead of asking you to guess a quality slider.
Lossless, lossy and visually lossless
Lossless compression keeps every pixel exactly as it was. It only stores the same data more efficiently, so for photos the savings are usually modest.
Lossy compression discards data to reach much smaller sizes. Pushed too far, it shows blur, blocky squares or colour banding.
Visually lossless compression is lossy compression with a limit: data is removed only while the result stays indistinguishable from the original to a human viewer. This is the approach Compresso uses. It compresses, compares the result with the original, and keeps a safer version whenever the difference could become visible.
What we measured on a real photo
We took the 1980 × 1440 photo of a dog on a beach that you can inspect with the loupe on our homepage. The original JPEG weighs 2,296,031 bytes. After compression it weighs 197,400 bytes, which is 91 percent smaller. The pixel dimensions did not change.
Then we compared the two files pixel by pixel. The average difference is 2.85 brightness levels out of 255, about 1 percent. 88.7 percent of pixels differ by 5 levels or less, and 99 percent by 11 levels or less. Only 61 of the 2.85 million pixels differ by 30 levels or more, and a single pixel reaches the maximum of 41: far too few and too small to spot.
The most interesting number: the compressed file contains about three times less fine-grained noise than the original (high-frequency energy of 0.52 against 1.63 in a flat area of water). That grain comes from the camera sensor and is invisible at normal size. Removing it is exactly where most of the 91 percent comes from, which is why, under a strong magnifier, the compressed copy can even look cleaner than the original.
When images really do lose quality
Quality loss usually comes from something other than a careful compressor. Resizing an image down throws pixels away for good. Saving a JPEG again and again with a low quality setting adds new artefacts each time. Messengers and social networks often resize and recompress uploads aggressively to save their own bandwidth.
To avoid this, keep an original, compress once from that original, and do not resize unless you actually need smaller dimensions. Compresso never resizes: the pixel dimensions of the result always match your upload.
How to check it yourself
Open the original and the compressed file side by side at 100 percent zoom, the way they will actually be seen. If you cannot tell which is which, the compression is visually lossless for that image. For a closer look, use the loupe on the Compresso homepage: its left half magnifies the original file and its right half the compressed one, eight times, at the same spot.