# Optimizing WebP Images

To optimize WebP images, run `npx optimo image.webp`. Optimo applies format-specific ImageMagick-powered compression that typically reduces WebP 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.webp
```

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

## When to use WebP

- web images
- thumbnails
- mixed photo + graphics

### Trade-offs

- Not universally supported by legacy tooling

## 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.  
[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.  
[JPEG XL](/content/optimize/jxl/index.html)  
Next-gen image format designed for high quality and 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 HEIC to WebP](/content/convert/heic-to-webp/index.html)  
[Convert PNG to WebP](/content/convert/png-to-webp/index.html)  
[Convert JPEG to WebP](/content/convert/jpeg-to-webp/index.html)  
[Convert WebP to PNG](/content/convert/webp-to-png/index.html)  
[Convert WebP to JPEG](/content/convert/webp-to-jpeg/index.html)  
[Convert WebP to AVIF](/content/convert/webp-to-avif/index.html)  
[Convert WebP to HEIC](/content/convert/webp-to-heic/index.html)  
[Convert WebP to JPEG XL](/content/convert/webp-to-jxl/index.html)

## More for WebP

[Compress WebP](/content/compress/webp/index.html)  
[Resize WebP](/content/resize/webp/index.html)  
[What is WebP?](/content/formats/webp/index.html)

## Compare formats

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

[PNG vs WebP](/content/compare/png-vs-webp/index.html)

## Frequently asked questions

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

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

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