Convert SVG to PNG

A practical, local workflow for converting SVG to PNG with optimo.

Last updated: 2026-03-18

To convert SVG to PNG, run npx optimo icon.svg --format png. PNG is useful when you need a raster asset for platforms that don’t support SVG. Optimo handles format conversion and optimization in a single step.

Command

Convert a file by targeting the output format:

npx optimo icon.svg --format png

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

Why convert?

  • PNG is useful when you need a raster asset for platforms that don’t support SVG.
  • Good for exporting fixed-size icons and previews.

Format notes

SVG
Vector format: crisp at any size and excellent for icons and illustrations.
PNG
Lossless image format with sharp edges and great support for transparency.

Not sure which to use?

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

Frequently asked questions

How do I convert SVG to PNG?
Run "npx optimo icon.svg --format png" in your terminal. Optimo handles the format conversion and applies optimization in a single step.
Why convert SVG to PNG?
PNG is useful when you need a raster asset for platforms that don’t support SVG. Good for exporting fixed-size icons and previews.
Does converting SVG to PNG lose quality?
Optimo uses sensible defaults that balance file size and quality. For lossless conversion (where possible), omit the --lossy flag. Add --dry-run to preview the result before committing.