View source on GitHub

To convert JPEG to PNG, run npx optimo photo.jpg --format png. Useful when you need lossless output or transparency (after editing). Optimo handles format conversion and optimization in a single step.

Command

Convert a file by targeting the output format:

npx optimo photo.jpg --format png

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

Why convert?

  • Useful when you need lossless output or transparency (after editing).
  • Often used for UI assets, though modern formats may be smaller.

Format notes

JPEG

The classic photo format: widely supported, good quality-to-size for photographs.

Optimize JPEG Compress JPEG Resize JPEG JPEG guide

PNG

Lossless image format with sharp edges and great support for transparency.

Optimize PNG Compress PNG Resize PNG PNG guide

Not sure which to use?

If you're choosing a delivery format, here's a quick comparison.

PNG vs JPEG