How image compression works
Image compression makes a file smaller by storing the same picture more efficiently. Lossless compression packs the data without changing a single pixel. Lossy compression goes further by discarding detail your eye is unlikely to miss — that is how a photo goes from 8MB to 400KB. The quality slider controls how much it discards.
Published September 7, 2026
Why an uncompressed image is huge
An image is a grid of pixels, and each pixel stores a colour as numbers — typically 3 bytes for red, green and blue. A 4000 x 3000 photo is 12 million pixels, so the raw data is about 36MB before anything clever happens. Compression is what turns that into a file you can actually send.
Lossless compression: smaller, pixel for pixel identical
Lossless methods find patterns and repetition and describe them compactly. Instead of storing '200 blue pixels in a row' as 200 separate values, it stores 'blue, 200 times'. When you open the file, the original is reconstructed exactly.
- PNG is the common lossless format. Great for flat graphics, screenshots of text and logos, where long runs of identical colour compress well.
- It struggles with photos, because photographic detail has few exact repeats, so there is little to pack.
- You can save and re-save a PNG forever without it degrading.
Lossy compression: smaller by leaving things out
Lossy formats like JPG and WebP exploit the limits of human vision. We notice changes in brightness far more than fine changes in colour, and we rarely notice small variations across a smooth area. So the encoder:
- 1Breaks the image into small blocks.
- 2Describes each block as a combination of simple patterns, from broad gradients to fine texture.
- 3Keeps the patterns your eye relies on and throws away the subtle ones, especially in colour.
- 4Stores what remains, which is now far smaller.
The discarded detail is gone for good. That is the trade: dramatically smaller files in exchange for detail that is, at normal viewing sizes, usually invisible.
What the quality slider actually does
The quality setting (0 to 100, or 0 to 1) tells the encoder how much to keep. Higher quality keeps more of the fine patterns and produces a bigger file; lower quality keeps fewer and produces a smaller one.
- 95-100
- Near-transparent quality, large files. Rarely worth it for web use.
- 80-90
- The practical range. Clean to the eye, files a fraction of the size.
- 60-75
- Visible softening on close inspection, still fine for small or fast-scrolling images.
- Below 50
- Blocky patches and colour banding start to show.
Let a tool find the number
If you have a target size — under 2MB, say — the Compress Image Under 2MB tool steps the quality down for you and stops as soon as the file fits, so you do not have to guess.
Generation loss: why you should compress once
Every time you open a JPG and save it again as a JPG, it is re-compressed, and the artefacts from the previous save get baked in and compressed again. After several rounds the image visibly deteriorates. Keep a lossless master if you can, and always compress from the highest-quality copy you have — not from one you already compressed.
Rules of thumb
- Photos and anything with gradients: lossy (JPG or WebP), quality around 80-85%.
- Flat graphics, logos, screenshots of text: lossless (PNG).
- Need it as small as possible for the web and you control the display: WebP.
- Compress from the original, once. Do not stack lossy saves.
- Resize to the size you actually need before compressing — fewer pixels is the biggest saving of all.
Images are processed on your device — nothing is uploaded.
Frequently asked questions
What is the difference between lossy and lossless compression?
Lossless compression makes a file smaller while keeping every pixel exactly the same, so it can be restored perfectly. Lossy compression makes files much smaller by permanently discarding detail that is hard to notice. PNG is lossless; JPG and WebP are lossy.
Does compressing an image reduce its resolution?
Not by itself. Compression changes how the pixels are stored, not how many there are. A compressed 1920 x 1080 image is still 1920 x 1080. Resizing is a separate step that does change the pixel count.
Why does my image look worse every time I save it?
If it is a JPG, each save re-compresses it and stacks new artefacts on top of the old ones — this is called generation loss. Work from a lossless master and export a fresh compressed copy each time instead of editing the compressed file.
What quality setting should I use?
For most web and social use, JPG or WebP quality around 80-85% is the sweet spot: clean to the eye at a small fraction of the maximum-quality file size. Go lower only for small images or when you have a strict size limit.
Try the tool
Related guides
- WebP vs JPG, explained
- JPG vs PNG for YouTube thumbnails
- How to compress a YouTube thumbnail under 2MB

