Compress JPEG XL files
JPEG XL can be excellent for high fidelity and efficient compression, but delivery support is limited. Treat it as an archival format unless you control the client.
Last updated: 2026-03-18
To compress JPEG XL files, run npx optimo image.jxl. 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 image.jxl
This is safe: optimo keeps the original if the output isn't smaller.
Two big levers
1) Lossy mode
npx optimo image.jxl --lossy
2) Resize (dimensions)
npx optimo image.jxl --resize w1280
Practical tips
- For broad web delivery, convert to WebP/AVIF/JPEG.
- JXL can be great for keeping a “high quality master” before generating derivatives.
- If you need predictable browser playback, don’t rely on JXL as the only output.
Related pages
Consider converting
Sometimes the best compression is picking a better delivery format.
Popular conversions
Frequently asked questions
- How do I compress JPEG XL files?
- Run "npx optimo image.jxl" to compress JPEG XL 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 JPEG XL 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.