Compress HEIC files
HEIC is great as a camera source, but it’s not web-native. Compression usually means converting to a delivery format like JPEG/WebP/AVIF.
Last updated: 2026-03-18
To compress HEIC files, run npx optimo photo.heic. Optimo applies ImageMagick-powered compression by default. For stronger reduction, use --lossy or --resize to shrink dimensions — often the single biggest lever for file size.
Start with optimo
First, run optimo on your image file:
npx optimo photo.heic
This is safe: optimo keeps the original if the output isn't smaller.
Two big levers
1) Lossy mode
npx optimo photo.heic --lossy
2) Resize (dimensions)
npx optimo photo.heic --resize w1280
Practical tips
- For the web, convert HEIC to JPEG/WebP/AVIF rather than shipping HEIC.
- If you need broad compatibility today, JPEG is the safest default.
- If you want smaller files and can accept modern tooling, prefer WebP/AVIF.
Related pages
Consider converting
Sometimes the best compression is picking a better delivery format.
Popular conversions
Frequently asked questions
- How do I compress HEIC files?
- Run "npx optimo photo.heic" to compress HEIC with lossless optimization. For stronger compression, add --lossy. For size reduction through resizing, add --resize followed by a percentage, dimensions, or target file size.
- What is the best way to reduce HEIC file size?
- The two biggest levers are resizing (reducing dimensions to match display size) and lossy compression. Resizing usually has a larger impact than codec-level compression. Sometimes converting to a more efficient format is the best approach.