To optimize JPEG XL images, run `npx optimo image.jxl`. Optimo applies format-specific ImageMagick-powered compression that typically reduces JPEG XL file size by 15–40% without visible quality loss. The original file is kept if the output is not smaller.

## Command

Start here. Run optimo on an image file:

```
npx optimo image.jxl
```

Tip: add `--dry-run` to preview changes.

## When to use JPEG XL

- archival
- high-fidelity images
- future-friendly workflows

### Trade-offs

- Browser support is limited
- Not a safe default for delivery

## Related formats

[PNG](/content/optimize/png/index.html)  
Lossless image format with sharp edges and great support for transparency.  
[JPEG](/content/optimize/jpeg/index.html)  
The classic photo format: widely supported, good quality-to-size for photographs.  
[WebP](/content/optimize/webp/index.html)  
Modern image format with great compression and broad browser support.  
[AVIF](/content/optimize/avif/index.html)  
High-compression modern image format that can beat WebP on size at similar quality.  
[HEIC](/content/optimize/heic/index.html)  
A common camera output format (especially Apple devices) with efficient compression.  
[GIF](/content/optimize/gif/index.html)  
Legacy animated image format that is still widely used for simple loops.  
[SVG](/content/optimize/svg/index.html)  
Vector format: crisp at any size and excellent for icons and illustrations.

## Related conversions

[Convert PNG to JPEG XL](/content/convert/png-to-jxl/index.html)  
[Convert JPEG to JPEG XL](/content/convert/jpeg-to-jxl/index.html)  
[Convert WebP to JPEG XL](/content/convert/webp-to-jxl/index.html)  
[Convert AVIF to JPEG XL](/content/convert/avif-to-jxl/index.html)  
[Convert HEIC to JPEG XL](/content/convert/heic-to-jxl/index.html)  
[Convert JPEG XL to PNG](/content/convert/jxl-to-png/index.html)  
[Convert JPEG XL to JPEG](/content/convert/jxl-to-jpeg/index.html)  
[Convert JPEG XL to WebP](/content/convert/jxl-to-webp/index.html)

## More for JPEG XL

[Compress JPEG XL](/content/compress/jxl/index.html)  
[Resize JPEG XL](/content/resize/jxl/index.html)  
[What is JPEG XL?](/content/formats/jxl/index.html)

## Compare formats

If you're picking a delivery format, comparisons can help.

[Browse comparisons](/content/compare/index.html)

## Frequently asked questions

How do I optimize JPEG XL files? Run "npx optimo image.jxl" in your terminal. Optimo applies format-specific ImageMagick-powered compression that reduces JPEG XL file size while preserving quality. The original file is kept if the optimized output is not smaller.

Is JPEG XL optimization lossless? By default, optimo uses lossless optimization for JPEG XL. For additional compression, add the --lossy flag to allow minor quality trade-offs for significantly smaller files.

What tools does optimo use for JPEG XL? Optimo uses ImageMagick, MozJPEG, and SVGO (depending on format) under the hood with format-specific settings tuned for JPEG XL files.
