Free plan

Trace to Vector (SVG / PDF)

Turn a logo or drawing into a sharp, scalable vector file
POST
/v1/images/vectorize

About this tool

This tool traces a normal picture (made of tiny dots) and redraws it as a vector file (made of lines and shapes) that stays sharp at any size. The result has a single colour, so it works best on logos, icons, scans and drawings with clear dark shapes. You can set how dark a part must be to count, remove tiny specks, smooth corners, swap light and dark, and choose the colour.
For example, you turn a photo of a hand-drawn logo into a file a printer can enlarge without blur.

How to use it

  1. Choose this tool.
  2. Add your pictures with Upload or drag and drop.
  3. Choose SVG or PDF as the result.
  4. Adjust the darkness cut-off, speck removal and colour if the shape looks wrong.
  5. Press Generate, then download the result.

What you get back

You get one vector file (SVG or PDF) for each picture, in a single colour. Download them to use or print.
TEST IT LIVE

Try Trace to Vector (SVG / PDF) in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/vectorize
Tool ID
images.vectorize
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Image
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/images/vectorize" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'file_type=svg' \
  -F 'threshold=50' \
  -F 'despeckle=2'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.vectorize({
    "images": 'photo.jpg',
    "file_type": "svg",
    "threshold": 50,
    "despeckle": 2
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->vectorize([
    'images' => 'photo.jpg',
    'file_type' => 'svg',
    'threshold' => 50,
    'despeckle' => 2,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Turn a raster image (logo, icon, scan, drawing) into a single-colour SVG or PDF vector with potrace: threshold, despeckle, smoothing, curve tolerance, invert, colour and an optional background. One result per image; counts one file per image.

Trace to Vector (SVG / PDF) accepts JPEG, PNG, WEBP, GIF, AVIF, TIFF, SVG, SVGZ, BMP, ICO, APNG, PNM and 9 more. You can send several files in one request.

Trace to Vector (SVG / PDF) is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/vectorize with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.