# Image to SVG Vectorizer (PNG, JPG to SVG, Bulk) (`toowl/image-to-svg`) Actor

Convert PNG, JPG and WebP images to scalable SVG vectors in bulk from URLs: logos, icons, illustrations, signatures, line art for Cricut and laser cutters. Colour or black-and-white, VTracer engine. Pay per image.

- **URL**: https://apify.com/toowl/image-to-svg.md
- **Developed by:** [Chalid Ade](https://apify.com/toowl) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 images vectorized

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Image to SVG Vectorizer (PNG, JPG to SVG, Bulk)

Convert **PNG, JPG and WebP images to SVG vectors** in bulk from URLs. Logos, icons, illustrations, signatures and line art become clean, scalable paths you can resize to any size, recolour, edit in Figma, Illustrator or Inkscape, or send to a **Cricut, Silhouette or laser cutter**.

Powered by **VTracer**, an open-source tracer that handles full-colour images (not just black and white like potrace).

### Use cases

- Rescue a **low-resolution logo** as a crisp SVG for print and the web.
- Turn hand-drawn sketches, stamps and **signatures** into vector shapes.
- **Cut files** for Cricut / Silhouette / laser engraving (black-and-white mode, light parts with `invert`).
- Bulk-convert an icon set or clip-art library to SVG.

### Features

- **Colour** (stacked colour layers) or **black and white** (one solid shape) mode.
- Control the look: colour detail, layer merge, speck removal, smooth curves / polygons / pixels, corner angle.
- Black and white: threshold, invert, **shape colour**.
- `viewBox` added, so the SVG scales cleanly.
- Large images are scaled down first (`maxSize`) so tracing stays fast.
- **Pay per image.** Failed images are free.

### Input

```json
{
  "files": [{ "url": "https://example.com/logo.png" }],
  "mode": "color",
  "colorDetail": 5,
  "filterSpeckle": 4
}
```

| Field | Default | Notes |
| --- | --- | --- |
| `files` | — | Image URLs (PNG, JPG, WebP, AVIF, GIF, TIFF) |
| `mode` | `color` | `color`, `bw` |
| `colorDetail` | 5 | 1–7 |
| `layerDifference` | 16 | 0–255 |
| `filterSpeckle` | 4 | px |
| `curveMode` | `spline` | `spline`, `polygon`, `pixel` |
| `cornerThreshold` | 60 | degrees |
| `threshold` | 128 | Black and white |
| `invert` | false | Black and white |
| `color` | `#000000` | Black and white shape colour |
| `background` | — | Hex colour behind transparent pixels (colour mode) |
| `maxSize` | 2000 | px |
| `timeoutSecs` | 120 | Per image |

Tip: for photos, lower `colorDetail` (3–4) and raise `filterSpeckle` (8–12) to get a poster-like result with far fewer paths.

### Output

```json
{
  "url": "https://example.com/logo.png",
  "name": "logo.png",
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/…/records/0001-logo.svg",
  "width": 512,
  "height": 512,
  "shapes": 14,
  "sizeBefore": 22870,
  "sizeAfter": 13429
}
```

### Pricing

Pay per event: one `image-vectorized` per image. Failed images are free.

### Free browser version

[toowl.my.id/en/image-to-svg](https://toowl.my.id/en/image-to-svg/) vectorizes images in your browser with a live preview, free, nothing uploaded.

### Call it from your code

```bash
curl -X POST "https://api.apify.com/v2/acts/toowl~image-to-svg/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"files":[{"url":"https://example.com/your-file"}]}'
```

The same call works from Python (`apify-client`), JavaScript, Make, Zapier and n8n (Apify app/node or a plain HTTP request).

### Use it from AI agents (MCP)

Add this Actor as a tool to Claude, Cursor, VS Code or any MCP client through Apify's MCP server:

```
https://mcp.apify.com/?actors=toowl/image-to-svg
```

The agent can then pass file URLs and read the results itself.

### More toowl file APIs

Speech to text & subtitles, AI vocal remover, text to speech, AI object remover, PDF to Markdown, PDF to Word & Excel, HTML/URL to PDF, OCR, Office to PDF, PDF compressor, PDF merge/split, PDF password protect, PDF to image, image to PDF, bulk watermark, image converter and compressor, background remover, AI upscaler, image to SVG, QR code and barcode generators, QR/barcode reader, favicon generator, video compressor, frame extractor and audio converter. All pay per file, all batch-friendly: [toowl.my.id/en/api](https://toowl.my.id/en/api/).

Questions or a format that fails? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `files` (type: `array`):

Direct links to the images: PNG, JPG, WebP, AVIF, GIF, TIFF. Logos, icons, illustrations, scans of drawings and signatures work best.

## `mode` (type: `string`):

Colour keeps every colour layer. Black and white makes one solid shape from the dark parts: best for signatures, line art, stencils, cutting machines (Cricut, laser).

## `colorDetail` (type: `integer`):

Colour mode, 1–7: lower merges similar shades into fewer, flatter layers (smaller files); higher keeps more shades.

## `layerDifference` (type: `integer`):

Colour mode, 0–255: how different two neighbouring colours must be to stay separate layers.

## `filterSpeckle` (type: `integer`):

Drops noise and tiny spots whose side is smaller than this. Raise it for scans and photos.

## `curveMode` (type: `string`):

Smooth curves for logos and drawings, straight polygons for geometric art, or square pixels for pixel art.

## `cornerThreshold` (type: `integer`):

Angles sharper than this stay corners; the rest become curves.

## `threshold` (type: `integer`):

0–255: pixels darker than this become the shape.

## `invert` (type: `boolean`):

Use the light areas as the shape instead (light logo on a dark background).

## `color` (type: `string`):

Hex colour of the traced shape, e.g. #1a7f37. Default black.

## `background` (type: `string`):

Colour mode: hex colour to put behind transparent pixels before tracing, e.g. #ffffff. Leave empty to keep transparency.

## `maxSize` (type: `integer`):

Larger images are scaled down before tracing (tracing time grows fast with size). The SVG scales to any size anyway.

## `timeoutSecs` (type: `integer`):

An image that takes longer is skipped with an error (not charged).

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped with an error (not charged).

## Actor input object example

```json
{
  "files": [
    {
      "url": "https://toowl.my.id/icon-512.png"
    }
  ],
  "mode": "color",
  "colorDetail": 5,
  "layerDifference": 16,
  "filterSpeckle": 4,
  "curveMode": "spline",
  "cornerThreshold": 60,
  "threshold": 128,
  "invert": false,
  "maxSize": 2000,
  "timeoutSecs": 120,
  "maxFileSizeMb": 30
}
```

# Actor output Schema

## `results` (type: `string`):

One row per input file, with a download link for the result where there is one.

## `files` (type: `string`):

Result files in the default key-value store, plus a SUMMARY record.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "files": [
        {
            "url": "https://toowl.my.id/icon-512.png"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("toowl/image-to-svg").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "files": [{ "url": "https://toowl.my.id/icon-512.png" }] }

# Run the Actor and wait for it to finish
run = client.actor("toowl/image-to-svg").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "files": [
    {
      "url": "https://toowl.my.id/icon-512.png"
    }
  ]
}' |
apify call toowl/image-to-svg --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,toowl/image-to-svg"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/KjFr6VwhXJtOqiOCi/builds/Etl5OL9rJJVwgsaZL/openapi.json
