Image to SVG Converter

Image to SVG Converter API

Design

Convert JPG, PNG, and other raster images to scalable SVG vector graphics. Perfect for logos, icons, and graphics that need infinite scaling without quality loss.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

20 requests per minute

Endpoints

1 endpoint available

Overview

Trace a raster image into SVG paths. Send the image as multipart form data in the file field and pick a preset. The response body is the SVG file (Content-Type: image/svg+xml).

Presets

  • bw: black and white shapes. Good for logos, line art and signatures.
  • poster: a few flat colours. Good for icons and illustrations.
  • photo (default): many colour layers. Closest to a photo, but the largest files.

Notes

  • Accepted input: JPEG, PNG, WebP, GIF (first frame), AVIF, TIFF and SVG, up to 20 MB and at most 4096 pixels per side. BMP, ICO and HEIC files return 415.
  • The EXIF orientation is applied before tracing.
  • Photos traced with the photo preset can give SVGs of several megabytes.
  • If the tracer is not available on the server the API returns 503; try again later.

Endpoints

POST
https://opentools.ca/api/v1/tools/image-to-svg
Trace a raster image into an SVG

Request Body

Content-Type: multipart/form-data

ParameterTypeRequiredDescription
file
file
Required
The image, up to 20 MB and 4096 pixels per side.
preset
string
Enum: bw, poster, photo
OptionalTracing preset.Default: photo

Response Example

HTTP/1.1 200 OK
Content-Type: image/svg+xml; charset=utf-8
Content-Disposition: attachment; filename="logo.svg"

<binary file data>

Error Codes

400
Bad Request - Missing file, unknown preset, or image over 4096 pixels per side
401
Unauthorized - Invalid or missing API key
403
Forbidden - API key is inactive or expired, or the request IP is not allowed
413
Payload Too Large - File over 20 MB
415
Unsupported Media Type - Not an image the server can read (BMP, ICO and HEIC are not supported)
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error
503
Service Unavailable - The SVG tracer is not available right now

Code Examples

curl -X POST https://opentools.ca/api/v1/tools/image-to-svg \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@logo.png" \
  -F "preset=poster" \
  -o logo.svg

Ready to get started?

Create an API key to start using the Image to SVG Converter API.

Rather use it in your browser? Open the Image to SVG Converter