Glossary Term
Image Compression
Image compression reduces the file size of an image while preserving acceptable visual quality — making it faster to share, upload, store, and load on the web.
Lossy vs lossless compression
Lossless compression reduces file size without removing any image data. The decompressed image is identical to the original. PNG uses lossless compression, which is why it is preferred for screenshots with sharp text and precise colors.
Lossy compression reduces file size by discarding some image data that the human eye is less likely to notice. JPG uses lossy compression. The result is a smaller file, but the quality cannot be fully restored. At moderate settings the difference is hard to see. At aggressive settings, artifacts become visible — especially around text and sharp edges.
WebP supports both lossy and lossless compression and typically produces smaller files than JPG or PNG at comparable quality.
Where image compression matters
- Web performance — large images slow down page loads. Compressed images load faster and use less bandwidth.
- Sharing and email — smaller files are easier to attach and faster to send.
- Storage — compressed images take up less disk space, which matters when capturing at volume.
- Screenshot workflows — batch captures can generate hundreds of images. Compression keeps the total output manageable.
- Documentation — screenshots embedded in documents or PDFs benefit from compression that balances quality and file size.
Common formats and their compression
- PNG — lossless. Best for screenshots with text, UI elements, and flat colors. Files can be large but quality is exact.
- JPG — lossy. Best for photos and images with gradients. Small file sizes but can introduce artifacts around sharp edges and text.
- WebP — supports both lossy and lossless. Generally produces smaller files than PNG or JPG at comparable quality. Widely supported in modern browsers.
- AVIF — newer format with excellent compression ratios. Browser support is growing but not yet universal.
Common mistakes with image compression
- Over-compressing screenshots with text. Lossy compression at aggressive settings makes text blurry and introduces artifacts around sharp edges. For screenshots, use PNG or WebP lossless when text clarity matters.
- Compressing an already compressed image. Re-compressing a JPG or lossy WebP degrades quality further with each pass. Always compress from the original source.
- Using JPG for screenshots with flat colors. JPG is designed for photographic content. Screenshots with solid backgrounds, UI elements, and text compress better and look sharper as PNG or WebP lossless.
- Not testing quality before bulk export. Always preview a sample at the target compression level before applying it to an entire batch.
Common Questions
Does compressing an image make it look worse?
Lossy compression can reduce visual quality, especially at aggressive settings. Lossless compression reduces file size without any quality loss. The right choice depends on how the image will be used.
Which format is best for screenshots?
PNG is best when sharp text and exact colors matter. JPG works for photographic content where some quality loss is acceptable. WebP offers a good balance of quality and file size for both.
Can I undo compression?
Lossless compression is fully reversible. Lossy compression is not — once quality is removed, it cannot be restored from the compressed file.
How much can I reduce file size?
It varies. PNG screenshots with large flat-color areas can often be reduced by 50-80% with lossless compression. JPG quality settings can reduce file size by 60-90%, with visible quality loss at the lower end.
Sources
- Use Imagemin to compress images — web.dev