Image to SVG
What traces well, what does not, and how to prepare a file before you send it.
Send it
POST /api/v1/svg/vectorize
curl -X POST https://www.amnt.io/api/v1/svg/vectorize \
-H "Authorization: Bearer amnt_sk_..." \
-H "Content-Type: application/json" \
-d '{ "image": "https://example.com/logo.png", "detail": "high" }'image accepts three things:
| Form | Example |
|---|---|
| https URL | "https://example.com/logo.png" |
| Data URI | "data:image/png;base64,iVBOR..." |
| Bare base64 | "iVBOR..." |
Limit: 10 MB. Anything larger is rejected with 400 before you are charged.
The URL is fetched server-side and checked against a private-address guard
before it is used. An image URL pointing at localhost, a link-local
address or an internal range is refused, not fetched.
What traces well
| Traces cleanly | Traces as an interpretation |
|---|---|
| Logos | Photographs |
| Icons and glyphs | Soft gradients |
| Flat illustration | Heavy texture or noise |
| Line art | Film grain |
| Diagrams and charts | Anything relying on blur |
| Pixel art | Very small text |
A photo is not a failure, it is a different output: you get an illustration that looks like the photo. If you need the photo, keep the photo.
Preparing a file
- Bigger is better. The engine enlarges 2x before tracing, but it cannot invent detail that is not in the source. 1024px on the long edge is a good floor.
- Flatten the background. A single solid colour behind the subject cuts cleanly. A photograph behind it does not.
- Do not pre-sharpen. Unsharp mask leaves a halo that traces as its own shape.
Detail
detail | Paths | Use it for |
|---|---|---|
low | fewest | Bold marks, screen print, vinyl cutting |
medium | balanced | Default. Removes the grain that makes a trace look traced |
high | most | Closest to the picture, largest file |
Colour count
colors caps the palette, 2 to 64. Lower means fewer shapes and a smaller
file. A two colour logo should be told so:
{ "image": "https://example.com/logo.png", "colors": 2 }palette goes further and snaps every colour to a list you supply, which is
how you make a trace land exactly on brand colours:
{
"image": "https://example.com/logo.png",
"palette": ["#1a2b3c", "#f5f0e8", "#d97757"]
}Background
For vectorize the default is "keep", because cutting a backdrop you did not
ask to cut would be rude. Set "background": "transparent" to remove a flat
one.
Transparent mode is what removes the pale ring round a cut-out. Each edge pixel takes the colour of the solid pixel just inside it, so the old background does not survive as a halo.