Skip to content
POST/api/v1/vectorize0.20 credits/call

Vectorize Image

Convert a raster image (PNG, JPG, WebP) into a clean, scalable SVG vector. Uses AI-powered tracing with automatic post-processing (SVGO optimization, color merging, speckle removal).

Request

curl -X POST https://vectosolve.com/api/v1/vectorize \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@image.png" \
-F "colors=4"

Parameters

NameTypeRequiredDescription
fileFileoptionalImage file via multipart/form-data. Max 4.5 MB per request (platform body limit). Supported: PNG, JPG, JPEG, WebP, GIF, SVG.
image_urlstringoptionalPublic URL of the image to vectorize. Alternative to file upload.
modestringoptionalMachine-ready output mode: "standard", "laser" (laser cutting), "cricut" (cutting machines), "embroidery" (embroidery digitizing), or "centerline" (one curve down the middle of each stroke, for scanned plans, line art and single-line lettering; filled shapes and photos are refused and not charged). Default: "standard".
output_formatstringoptional"svg" or "dxf". With "dxf", the response additionally includes inline DXF content (data.dxf) and format becomes "dxf". If DXF conversion fails, the SVG is still returned (no refund) with a data.dxf_error field. Default: "svg".
dxf_versionstringoptionalDXF only: AutoCAD version of the output file. "R12" (default): classic POLYLINE/VERTEX entities, reads in every CAM since the 1990s. "AC1015" (AutoCAD 2000): LWPOLYLINE entities on a complete R2000 skeleton (handles, symbol tables, block records), and SPLINE entities in centerline mode; opens in Rhino, Fusion 360 and SolidWorks. Both are re-read by the ezdxf reference parser in the test suite.
unitsstringoptionalDXF only: drawing units, "mm", "in", or "cm". Default: "mm".
cam_presetstringoptionalDXF only: "lightburn" splits entities into CUT/ENGRAVE layers; "vcarve" and "generic" declare named layer tables for CAM software (entities stay on layer 0).
target_widthnumberoptionalDXF only: scales the drawing to this width in the chosen units (1-10000).
planarbooleanoptionalWhen "true", flattens stacked shapes into flush, non-overlapping tiles (a planar partition) — no z-fighting when extruding to 3D or layering materials. Curves are sampled to dense polylines (mesh-ready geometry, larger file). Applies to the SVG and, with output_format=dxf, to the DXF too. Above 600 filled paths the flatten is skipped and the response carries data.planar_skipped with the reason. Default: false.
colorsnumberoptionalInteger 0-64. Hard cap on the exact number of colors in the output; colors are merged perceptually in OKLab space. 0 (or omitted) = auto. Example: colors=4 forces a clean 4-color separation for screen printing or vinyl.
palettestringoptionalComma-separated hex colors, e.g. "#000000,#ff0000,#00ff00". Snaps every output color to the nearest color in your provided stock/thread palette — ideal for locking output to available vinyl, filament, or embroidery thread colors.
verifybooleanoptionalWhen "true", the response adds a `data.verify` Machine-Verified Export report: a 0–100 confidence score plus per-check pass/warn/fail (geometry present, valid coordinates, real-world size in mm, closed cut contours, minimum feature size, clean segments, cut/color layers). Advisory only — it never affects billing or the returned SVG/DXF. Ideal for gating downstream automation on machine-readiness.

Either file or image_url must be provided.

Response

200 OK
{
"success": true,
"data": {
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" ...>...</svg>",
"svg_url": "https://...",
"format": "svg",
"mode": "standard",
"processing_time_ms": 3200,
"source_quality": {
"level": "amber",
"source_width": 1200,
"source_height": 900,
"upscaled": false,
"thinnest_line_px": 2.0,
"smallest_lettering_px": 14,
"review_recommended": true,
"note": "The source is 1200x900px. The thinnest line in the artwork measures about 2px, too thin to survive tracing cleanly. The smallest lettering is about 14px tall; below 20px no tracer keeps letterforms clean. It converted, but fine detail and small lettering may not have survived. Worth a look before a print run."
}
},
"credits": {
"used": 0.20,
"remaining": 9.80
}
}

Authentication Required

Include Authorization: Bearer vs_xxx in all requests. Rate limit: 60 requests/minute.