Lossy vs lossless compression, explained simply
Updated 11 October 2026
When a form forces your photo under 20 KB, it often comes out looking soft or patchy. That is not a fault in your phone or the tool; it is how image compression works. Knowing a little about it helps you get noticeably better results at the same file size.
Lossless: nothing is thrown away
Lossless compression stores data more efficiently without losing any of it, like packing a suitcase more neatly. When you open the file, every pixel is exactly as it was. PNG is the common lossless image format. It works brilliantly on images with large areas of the same colour, such as screenshots, diagrams or a signature on white, but a photograph full of fine detail and noise does not shrink much. A small passport photo as PNG might be several hundred KB.
Lossy: throw away what the eye will not miss
Lossy compression permanently discards some information to make the file far smaller. JPEG is the classic example. In plain terms, it does three things:
- Separates brightness from colour. Our eyes are much more sensitive to brightness than to colour detail. So JPEG commonly stores colour at lower resolution than brightness, often with one colour sample for every 2 × 2 block of pixels. This is called chroma subsampling, and on its own it cuts the data considerably with little visible change.
- Works in 8 × 8 pixel blocks. The image is divided into small squares of 8 × 8 pixels. Each block is described as a mix of simple patterns, from smooth to finely detailed.
- Rounds off fine detail. The quality setting decides how roughly each block's fine-detail patterns are rounded. At high quality, little is lost. At low quality, most fine detail is reduced to zero and the block is described only by its broad shading.
That is why heavily compressed JPEGs show blockiness (visible 8 × 8 squares in smooth areas like cheeks and backgrounds), ringing (faint halos around sharp edges such as hair against a white wall) and smearing of fine textures.
Every time you open a JPEG, edit it and save it again as JPEG, the rounding happens again. So always start from the original photo, not from a file you already compressed.
Why a 20 KB photo looks soft
Consider a 200 × 230 px photo: 46,000 pixels, each with red, green and blue values, which is about 138,000 bytes uncompressed. Squeezing that into 20 KB (about 20,000 bytes) means storing it in less than one-sixth of the space. JPEG manages this well at moderate quality, but if the photo also has a busy background or a lot of noise from low light, the encoder must spend bytes on that clutter and has less left for your face.
Worked comparison
Illustrative, typical sizes for the same 200 × 230 px portrait on a plain light background:
| Setting | Typical size | How it looks |
|---|---|---|
| PNG (lossless) | 70 to 110 KB | Perfect, but often over the limit |
| JPEG quality 95 | 35 to 50 KB | Indistinguishable from original |
| JPEG quality 80 | 15 to 25 KB | Very good, hard to tell apart |
| JPEG quality 60 | 10 to 16 KB | Fine at normal viewing; slight softness |
| JPEG quality 30 | 6 to 9 KB | Visible blocks and halos |
The same settings on a photo with a patterned curtain behind could easily be 50% larger.
Tips for the best quality at small sizes
- Crop first. Remove everything except head and shoulders. Fewer wasted pixels means more bytes for your face.
- Use a plain background. A smooth white wall costs almost nothing to store; a bookshelf costs a lot.
- Use good light. Daylight from a window in front of you reduces sensor noise, and noise is expensive to compress.
- Resize, then compress. Shrink to the required pixel size first and then adjust quality, rather than using very low quality at a large size.
- Do not oversharpen. Sharpening adds fine edges that cost bytes and make ringing worse.
- Use the target-size option. Our compressor searches for the highest quality that fits your KB limit, so you do not have to guess. For PDFs, see Compress PDF.
Questions people ask
- What is the difference between lossy and lossless compression?
- Lossless keeps every pixel exactly and can be reversed perfectly; lossy permanently removes detail the eye is less likely to notice, giving much smaller files.
- Is JPEG lossy or lossless?
- Standard JPEG is lossy. PNG is lossless.
- Why does my photo look blocky after compression?
- JPEG works in 8 x 8 pixel blocks, and at low quality the fine detail in each block is discarded, so the edges of the blocks become visible.
- Does saving a JPEG again reduce its quality?
- Yes, each re-save as JPEG applies lossy compression again. Always work from the original photo.
- How can I keep good quality under 20 KB?
- Crop to head and shoulders, use a plain background and good light, resize to the exact pixels needed, then compress.