Getting Started with Covecto: From PNG to SVG in Seconds

Getting Started with Covecto: From PNG to SVG in Seconds

Covecto is a command-line vectorization tool written in Rust that turns PNGs into clean SVGs in a single command. No GUI, just fast results.

This tutorial covers installing Covecto, running your first conversion, picking the right engine, batch processing, and standing up a REST API.

What is Covecto

Covecto is an open-source raster-to-vector conversion tool built in Rust and released under the MIT license (currently v0.1.1). It ships with two vectorization engines, four built-in profiles, and support for SVG, PDF, and EPS output. You can run it as a CLI, embed it as a library, or serve it over HTTP.

The two engines handle different image types:

  • PixelExact preserves pixel boundaries. It is ideal for icons, pixel art, and anything with hard edges.
  • Spline traces smooth curves through the image. It works well for photos and illustrations with gradients.

If you are not sure which one to use, the default Auto mode picks for you based on image characteristics.

Install

The fastest way to get Covecto is the install script:


curl -fsSL https://codecora.dev/covecto/install | sh

This downloads the prebuilt binary for your platform and places it on your PATH. Verify it landed:


covecto --version

You should see covecto 0.1.1 (or newer).

Prefer Docker? Pull the official image:


docker pull ghcr.io/codecoradev/covecto:latest

You can then run any command through the container:


docker run --rm -v "$PWD:/work" ghcr.io/codecoradev/covecto:latest \
  convert /work/icon.png -o /work/icon.svg

Your First Vectorization

Start simple. Grab a PNG and convert it:


covecto convert logo.png -o logo.svg

That is it. Covecto inspects the image, selects an engine, and writes the SVG. The output file keeps the same color palette as the source.

Want PDF or EPS instead? Change the extension and Covecto handles the rest:


covecto convert logo.png -o logo.pdf
covecto convert logo.png -o logo.eps

Engine Selection

The Auto mode is smart, but sometimes you want explicit control. Pass the --engine flag:


# Pixel-perfect tracing for icons
covecto convert app-icon.png --engine pixelexact -o app-icon.svg

# Smooth spline tracing for photos
covecto convert portrait.png --engine spline -o portrait.svg

Covecto also ships four built-in profiles that bundle engine choice and tuning parameters for common use cases:

Profile | Best For

`icon` | Small icons, app assets, pixel art

`logo` | Brand logos with flat colors

`photo` | Photographs and detailed illustrations

`lineart` | Sketches, line drawings, manga

Use a profile with --profile:


covecto convert sketch.png --profile lineart -o sketch.svg
covecto convert brand-mark.png --profile logo -o brand-mark.svg

Profiles save you from fiddling with individual parameters. Start with the one that matches your image type, then fine-tune only if the result needs work.

Batch Processing

Converting one image at a time gets tedious fast. Covecto supports batch processing with glob patterns and recursive directory scanning. Behind the scenes it uses Rayon for parallel execution, so multi-core machines chew through large folders quickly.

Convert every PNG in a directory:


covecto convert ./assets/*.png --output-dir ./svg/

Recursively scan subdirectories:


covecto convert ./images/**/*.png --output-dir ./svg/ --recursive

Mix in a profile for consistent results across a batch:


covecto convert ./icons/**/*.png --profile icon --output-dir ./svg/ --recursive

Covecto preserves the directory structure in the output folder, so your organized asset tree stays intact.

REST API

For web apps and microservices, Covecto ships a built-in HTTP server. Start it with:


covecto serve --port 3000

The server exposes a simple endpoint for on-demand conversion. You POST an image and receive a vectorized file back:


curl -X POST http://localhost:3000/convert \
  -F "[email protected]" \
  -F "engine=auto" \
  -o logo.svg

This is handy for pipelines where conversion happens on demand rather than ahead of time.

When to Use Which Engine

Choosing the right engine up front saves iteration time. Here is a quick guide.

Use PixelExact when your source has sharp edges, flat colors, and a small palette. Think app icons, pixel art, UI glyphs, and simple logos. PixelExact traces each pixel boundary precisely, so the SVG stays crisp at any resolution without introducing artifacts.

Use Spline when your source has smooth curves, gradients, or photographic detail. Photos, digital paintings, detailed illustrations. Spline fits bezier curves through the image data, producing organic shapes that scale cleanly.

Use Auto when you are processing mixed batches and do not want to think about it. Auto inspects each image and routes it to the right engine. It is the safest default for ad-hoc conversions and batch jobs with varied content.

Use profiles when you know the image category. The icon and logo profiles lean on PixelExact with tuned parameters. The photo profile uses Spline for detail. The lineart profile focuses on stroke detection.

Wrapping Up

Covecto gives you a fast, scriptable path from raster to vector. The CLI handles single files and batch jobs with parallel processing. The profiles cover the common cases without forcing you to learn every parameter. And the REST API makes it trivial to add vectorization to any service.

To recap:

1. Install with the one-liner script or pull the Docker image.

2. Convert a single file with covecto convert input.png -o output.svg.

3. Pick a profile or engine based on your image type.

4. Batch process folders with glob patterns and recursive scanning.

5. Serve the REST API for on-demand conversion in web apps.

Covecto is MIT-licensed and the source is on GitHub. Star it, file issues, and contribute if you find it useful. Happy vectorizing.