Image Resizing: Fit Modes, Quality & Best Practices
Understand contain vs cover vs stretch, how retina assets work, and when to pick JPEG/PNG/WebP.
Resize modes
- Exact: Set target width/height. Use contain to pad, cover to crop, or stretch to ignore aspect.
- Max: Cap the image to max width/height while keeping aspect (contain). Optional “downscale only”.
- Percent: Scale by a percentage (e.g., 50%).
Fit options
Contain pads to the box; Cover fills the box and crops overflow; Stretch ignores aspect for exact pixels.
Retina variants
Export 1x/2x/3x sizes for UI assets. The naming pattern inserts {scale} as @1x, @2x, etc.
Formats
Photos: JPEG/WebP. UI & logos: PNG/WebP (preserve alpha). WebP is a great default for the web.
FAQ
Can I set DPI?
Browsers don’t reliably embed DPI in canvas exports; use the backend for print-exact DPI.
Will EXIF metadata be preserved?
Canvas export strips EXIF by default. The backend can preserve or strip metadata.