To convert PNG to WebP, run npx optimo image.png --format webp. WebP can be significantly smaller than PNG while preserving quality. Optimo handles format conversion and optimization in a single step.
Command
Convert a file by targeting the output format:
npx optimo image.png --format webp
Tip: add --dry-run to preview changes.
Why convert?
- WebP can be significantly smaller than PNG while preserving quality.
- Great for web delivery when you don’t need a pure lossless PNG.
Format notes
PNG
Lossless image format with sharp edges and great support for transparency.
Optimize PNG Compress PNG Resize PNG PNG guide
WebP
Modern image format with great compression and broad browser support.
Optimize WebP Compress WebP Resize WebP WebP guide
Not sure which to use?
If you're choosing a delivery format, here's a quick comparison.