Quick answer: image compression makes a file smaller by storing the same picture more efficiently. Lossless compression finds patterns and stores them compactly, so the original can be rebuilt exactly. Lossy compression also throws away detail your eyes are least likely to notice, which is why it can shrink photos far more.
Lossless compression: same pixels, fewer bytes
PNG is the familiar example. It first applies a filter that predicts each pixel from its neighbours and stores only the difference, then compresses the result with the DEFLATE algorithm, the same family of technique used in ZIP files. Because areas of flat colour produce long runs of identical values, screenshots, logos and diagrams compress very well. A photograph, where nearly every pixel differs slightly from its neighbours, compresses much less.
Lossy compression: discarding what you will not miss
JPG works in several stages. The details differ between encoders, but the idea is consistent:
- Separate brightness from colour. The image is converted so that brightness and colour are stored separately. Human vision is far more sensitive to brightness detail than to colour detail.
- Reduce colour detail. Colour information is often stored at lower resolution than brightness (called chroma subsampling). This alone saves a lot with little visible change.
- Split into small blocks. The image is divided into 8 × 8 pixel blocks, and each block is transformed (using a discrete cosine transform) into a set of patterns, from broad gradients to fine detail.
- Quantise. Fine-detail values are rounded aggressively; broad ones are kept more accurately. This is the lossy step, and it is what the quality setting controls.
- Pack the result. The remaining numbers are stored with lossless entropy coding.
What the quality slider really does
A lower quality value means harsher rounding in step 4. File size falls quickly at first with little visible change, then the picture starts to show its shortcuts. The scale is not standardised: "80" from two different programs may not look identical. Rather than trusting a number, move the slider while watching the preview and the size, and stop when you can first see a difference, then step back slightly.
What compression damage looks like
- Blockiness: visible 8 × 8 squares, especially in smooth areas.
- Ringing: fuzzy halos around sharp edges and text.
- Banding: smooth gradients turn into visible steps.
- Colour bleeding: colours smear across edges.
These show up first in sharp text and graphics, which is why screenshots usually belong in PNG and photos in JPG or WebP.
Why saving a JPG again makes it worse
Each lossy save rounds the data again, and rounding errors accumulate. Open, edit and re-save a JPG several times and quality drops each generation. Keep an original, and always compress from that original rather than from a previous compressed copy.
Pixels matter more than settings
File size grows with the number of pixels. A 4000 × 3000 photo shown in a 800-pixel-wide space carries far more data than needed. Resizing to the displayed size, then compressing, often saves more than any quality setting. Try the Image Resizer first, then the Image Compressor.
Next: compare WebP and JPG, or follow the step-by-step guide to compressing an image without losing quality.