convertVector

March 28, 2026 ยท View on GitHub

Convert vector graphics between popular formats.

Usage

openGyver convertVector <input-file> [flags]

Prerequisites

One of the following must be installed:

ToolBest ForInstall (macOS)Install (Linux)
rsvg-convert (librsvg)SVG to PNG/PDF (fast, lightweight)brew install librsvgapt install librsvg2-bin
InkscapeAll vector format conversionsbrew install inkscapeapt install inkscape

SVG to PNG/PDF conversions use rsvg-convert if available, or Inkscape as a fallback. Other vector format conversions require Inkscape.

Arguments

ArgumentRequiredDescription
input-fileYesPath to the input vector file

Flags

FlagShortTypeDefaultDescription
--output-ostring""Output file path (required)
--widthint0Output width in pixels (for rasterization)
--heightint0Output height in pixels (for rasterization)
--help-hboolfalseShow help for convertVector

Supported Formats (23)

Vector Formats

FormatExtension(s)Description
SVG.svgScalable Vector Graphics
SVGZ.svgzCompressed SVG
EPS.epsEncapsulated PostScript
PDF.pdfPortable Document Format
PS.psPostScript
EMF.emfEnhanced Windows Metafile
WMF.wmfWindows Metafile
AI.aiAdobe Illustrator
CDR.cdrCorelDRAW
CDT.cdtCorelDRAW Template
CCX.ccxCorel Compressed Exchange
CMX.cmxCorel Metafile Exchange
CGM.cgmComputer Graphics Metafile
VSD.vsdMicrosoft Visio
FIG.figXfig
PLT.pltHPGL Plotter
DST.dstEmbroidery (Tajima)
PES.pesEmbroidery (Brother)
EXP.expEmbroidery (Melco)
SK.skSketch
SK1.sk1Sketch v1

Raster Output

FormatExtensionDescription
PNG.pngRasterize vector to PNG image
JPG.jpgRasterize vector to JPEG image

Conversion Tool Selection

InputOutputPreferred ToolFallback
SVG/SVGZPNGrsvg-convertInkscape
SVG/SVGZPDFrsvg-convertInkscape
SVG/SVGZPS/EPSrsvg-convertInkscape
SVG/SVGZSVG/EMF/WMFInkscape--
Any otherAnyInkscape--

Examples

# Convert SVG to PNG
openGyver convertVector logo.svg -o logo.png

# Convert SVG to PDF
openGyver convertVector logo.svg -o logo.pdf

# Convert SVG to EPS
openGyver convertVector logo.svg -o logo.eps

# Rasterize SVG to specific dimensions
openGyver convertVector logo.svg -o logo.png --width 1024 --height 768

# Convert EPS to SVG
openGyver convertVector diagram.eps -o diagram.svg

# Convert Adobe Illustrator file to SVG
openGyver convertVector drawing.ai -o drawing.svg

# Generate a high-resolution PNG from SVG
openGyver convertVector icon.svg -o icon.png --width 2048

# Convert SVG to PostScript
openGyver convertVector chart.svg -o chart.ps

# Convert Visio diagram to SVG
openGyver convertVector diagram.vsd -o diagram.svg

# Convert SVG to EMF (Windows Metafile)
openGyver convertVector logo.svg -o logo.emf

# Convert CorelDRAW file to SVG
openGyver convertVector design.cdr -o design.svg

# Rasterize with only width (height proportional)
openGyver convertVector banner.svg -o banner.png --width 1200

Notes

  • The input and output formats are auto-detected from file extensions.
  • When converting SVG to raster (PNG/JPG), use --width and --height to control the output resolution. If only one dimension is specified, the other is determined by the tool (rsvg-convert or Inkscape) to maintain aspect ratio.
  • rsvg-convert is preferred for SVG input because it is faster and more lightweight than Inkscape.
  • Inkscape is required for non-SVG input formats and for output formats like EMF and WMF.
  • If neither rsvg-convert nor Inkscape is found, the command will return an error with installation instructions.
  • Embroidery format support (DST, PES, EXP) requires Inkscape with appropriate extensions.