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

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

## When to use PNG

- UI assets
- logos
- icons
- graphics with transparency

### Trade-offs

- Larger files than modern formats
- Not ideal for photos

## Related formats

- [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.
- [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 PNG to WebP](/content/convert/png-to-webp/index.html)
- [Convert PNG to AVIF](/content/convert/png-to-avif/index.html)
- [Convert PNG to JPEG](/content/convert/png-to-jpeg/index.html)
- [Convert PNG to JPEG XL](/content/convert/png-to-jxl/index.html)
- [Convert PNG to HEIC](/content/convert/png-to-heic/index.html)
- [Convert PNG to GIF](/content/convert/png-to-gif/index.html)
- [Convert JPEG to PNG](/content/convert/jpeg-to-png/index.html)
- [Convert WebP to PNG](/content/convert/webp-to-png/index.html)

## More for PNG

- [Compress PNG](/content/compress/png/index.html)
- [Resize PNG](/content/resize/png/index.html)
- [What is PNG?](/content/formats/png/index.html)

## Compare formats

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

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

## Frequently asked questions

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

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

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