[View source on GitHub](https://github.com/microlinkhq/optimo)

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](/content/optimize/jpeg/index.html) [Compress JPEG](/content/compress/jpeg/index.html) [Resize JPEG](/content/resize/jpeg/index.html) [JPEG guide](/content/formats/jpeg/index.html)

### PNG

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

[Optimize PNG](/content/optimize/png/index.html) [Compress PNG](/content/compress/png/index.html) [Resize PNG](/content/resize/png/index.html) [PNG guide](/content/formats/png/index.html)

## Not sure which to use?

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

[PNG vs JPEG](/content/compare/png-vs-jpeg/index.html)
