Resize JPEG XL files
Resizing is usually the biggest lever for reducing JPEG XL file size.
Last updated: 2026-03-18
To resize JPEG XL files, run npx optimo image.jxl --resize <value>. Optimo supports three modes: percentage (50%), dimensions (w960), and target file size (150kB). Resizing reduces both dimensions and file size in one step — often more effective than compression alone.
Resize by percentage
Quick way to scale down when you don't know exact dimensions yet.
npx optimo image.jxl --resize 50%
Resize by dimensions
Cap width or height to match how the asset is displayed.
npx optimo image.jxl --resize w960
Use w for width and h for height.
Resize to a target file size
Useful for thumbnails and previews when you want predictable budgets.
npx optimo image.jxl --resize 150kB
Start with a budget you can ship everywhere, then adjust based on quality.
JPEG XL-specific tips
- Resize to your max render size before generating final delivery formats.
- Use size targets (`--resize 200kB`) for thumbnails derived from a master.
- For UI assets, consider SVG/PNG/WebP depending on needs.
Related pages
Frequently asked questions
- How do I resize JPEG XL files?
- Optimo supports three resize modes: percentage (--resize 50%), dimensions (--resize w960 or --resize h480), and target file size (--resize 150kB). Run "npx optimo image.jxl --resize <value>" to resize and optimize in one step.
- What is the best resize mode for JPEG XL?
- Use dimensions (--resize w960) when you know the display size. Use percentage (--resize 50%) for quick scaling. Use target file size (--resize 150kB) for thumbnails and budgets. Resizing is usually the single biggest lever for reducing JPEG XL file size.