Skip to content

Batch Processing ​

Covecto handles multiple files efficiently — with parallel processing via Rayon.

Directory Mode ​

bash
# All images in a directory
covecto ./icons/ -o ./output/

Files maintain their original names with the output extension.

Glob Patterns ​

bash
# PNG files only
covecto "screenshots/*.png" -o ./vectorized/

# Multiple patterns
covecto "assets/**/*.png" -o ./svg/

Recursive Scan ​

bash
# All images in all subdirectories
covecto ./assets/ --recursive -o ./svg-output/

Output Templates ​

Customize output filenames with placeholders:

PlaceholderDescriptionExample
{stem}Filename without extensionicon-32x32
{name}Same as stemicon-32x32
{ext}Output format extensionsvg
bash
# Prefix
covecto ./icons/ --output-template "vec-{stem}.{ext}" -o ./out/

# Custom directory structure
covecto ./photos/ --output-template "{stem}.{ext}" --output-dir ./vectorized/

Collision Handling ​

When output filenames collide, Covecto appends an incremental suffix:

`` input/a.png → output/a.svg subdir/a.png → output/a_1.svg


## Parallel Processing

Batch mode uses Rayon for automatic parallelism. The number of threads defaults to your CPU core count.

## JSON Output

Get machine-readable results for pipelines:

```bash
# Compact JSON
covecto ./icons/ --json

# Pretty-printed
covecto ./icons/ --json-pretty

# Example output
[
  {
    "input": "icon-16x16.png",
    "output": "output/icon-16x16.svg",
    "engine": "pixel-exact",
    "metadata": { "path_count": 12, "processing_time_ms": 1.2 }
  }
]

Dry Run ​

Preview what would be processed, without writing anything:

bash
covecto ./assets/ --recursive --dry-run
Would process 3 files:
  assets/icon.png → assets/vectorized/icon.svg (engine: pixel-exact (auto))
  assets/photo.jpg → assets/vectorized/photo.svg (engine: spline (auto))
  assets/broken.png → error: ...

The engine shown is exactly the one a real run would use: with --engine or a --profile it is shown as configured, without reading the files; with the default auto engine each image is decoded (in parallel) and the same auto-selection runs as in a real conversion, marked (auto).

With the auto engine, unreadable files are listed with their error (on stderr) and the dry run exits with code 1. With --engine or --profile the files are not read, so a broken file only shows up in the real run.