Lossless compression represents the same decoded information more efficiently. Lossy compression removes or approximates information that an encoder predicts will matter less to perception. Both are legitimate tools; the right choice depends on what the image contains and what must survive.
What lossless means
For a normal lossless pixel workflow, decoding and re-encoding should preserve the pixel values represented by the format. PNG is the familiar web example. Its filters and deflate compression can change file structure without using a JPEG-style visual quality reduction.
Lossless does not automatically mean “small.” A large, noisy photograph can be enormous as PNG because every variation must remain. Metadata, color profiles, and container details are separate from pixel losslessness and may change in an optimization workflow.
Lossless output is useful for:
- Screenshots with small text
- Interface graphics
- Line art and diagrams
- Images that will be edited repeatedly
- Transparency requiring exact edge pixels
- Technical pixels that must not be approximated
What lossy means
Lossy encoders reduce size by approximating spatial detail, color information, or repeated patterns. JPEG uses block-based transforms and commonly reduces chroma detail. WebP and AVIF use newer techniques and can provide different efficiency and feature tradeoffs.
At a sensible setting, the change may be difficult to notice at normal viewing size. At aggressive settings, common artifacts include blockiness, ringing near edges, smeared texture, banding in gradients, and damaged text.
Lossy output is often appropriate for:
- Photographs
- Large hero images
- Thumbnails
- Social sharing copies
- Content where a modest visual tradeoff brings a meaningful byte reduction
The generation problem
Repeated lossy saves can accumulate damage. Opening a JPEG, editing it, and saving as JPEG again creates another lossy generation. Keep a high-quality master and derive delivery files from that master rather than repeatedly recompressing an already compressed copy.
Converting JPEG to PNG does not restore information that JPEG removed. It only stores the already-decoded pixels in a lossless container, often producing a larger file.
Hybrid decisions
Modern formats can support more than one mode. WebP has lossy and lossless forms. AVIF settings and encoder behavior can vary. A transparent image can also combine photographic content with sharp alpha edges, so one decision may not fit the whole asset.
Dimensions matter as much as codec mode. A 4,000-pixel lossless image may be a worse delivery choice than a carefully resized lossy image that matches the page’s actual needs.
How to choose
Ask four questions:
- Are exact pixels required?
- Does the image contain text or hard-edged graphics?
- Is the source a photograph?
- What is the maximum real display size?
Then test. Compare output at the intended viewing size and inspect critical regions. Use byte savings as a measurement, not as the only objective.
Metadata removal is another independent axis. A decode-and-re-encode path commonly removes EXIF and GPS even if the pixel encoding is lossless. Preserve an original if capture information matters.
The PNG compressor explains the limits of lossless PNG reduction, while the JPG compressor and WebP compressor expose quality controls for photographic output.
Put the guidance into practice
Use the image compressor, image converter, or metadata cleaner to test these choices locally with your own files.