Image Compression: Formats, Quality & Best Practices
When to choose JPEG vs WebP vs PNG, how quality affects size, and tips for clean downsizing.
Formats
- JPEG: best for photos; small sizes, no alpha channel.
- WebP: modern and small; supports transparency; widely supported.
- PNG: lossless; ideal for UI, logos, and images with sharp edges/transparency.
Quality & target size
Quality is a 0–1 slider; lower values make smaller files but can introduce artifacts. If you must hit a budget, set a Target size and we’ll iterate quality to get close.
Resizing rules
We maintain aspect ratio and cap images to the chosen max width/height. For web, 1920×1080 usually suffices for hero images; thumbnails can be 320–640 px wide.
EXIF orientation
Some cameras save photos “sideways” with an EXIF Orientation flag. We normalize the pixels so your exported file looks correct everywhere.
FAQ
Does PNG quality do anything?
Browsers don’t expose PNG compression levels via canvas; choose WebP or JPEG for smaller output if quality allows.
Will metadata be preserved?
Canvas exports typically strip EXIF/IPTC. Use the backend if you need fine-grained control.