Skip to main content

VectoSolve Python SDK

Official Python client for the VectoSolve API — AI-powered image vectorization, background removal, upscaling, and SVG generation.

PyPI Python License: MIT

Installation

pip install vectosolve

Quick Start

from vectosolve import VectoSolve

client = VectoSolve(api_key="vs_your_api_key")

# Convert an image to SVG
result = client.vectorize("photo.png")
result.save("output.svg")
print(f"Credits remaining: {result.credits.remaining}")

Get your API key at vectosolve.com/dashboard.

Features

Method Description Credits
vectorize() Convert raster images (PNG, JPG, WebP) to clean SVG 1
remove_background() Remove image backgrounds with AI 1
upscale() AI-powered image upscaling (2x/4x) 1
generate_svg() Generate SVGs from text prompts 1
generate_logo() AI logo generation with multiple variants 1-2
generate_pattern() Generate seamless tileable patterns 1
batch() Process up to 10 images in a single request 1/image

Usage

Vectorize (Image to SVG)

# From a local file
result = client.vectorize("photo.png")
result.save("output.svg")

# From a URL
result = client.vectorize("https://example.com/image.png")
print(result.svg)  # Raw SVG string

Remove Background

result = client.remove_background("product.jpg")
print(result.image_url)  # URL of the processed image

Upscale

result = client.upscale("small-image.png")
print(result.image_url)

Generate SVG from Text

result = client.generate_svg(
    "a golden retriever playing fetch in a park",
    style="vector_illustration",
    size="1024x1024",
    colors=["#f4a460", "#228b22", "#87ceeb"],
)
result.save("dog.svg")

Available styles: vector_illustration, vector_illustration/line_art, vector_illustration/engraving, vector_illustration/linocut, vector_illustration/bold_stroke, vector_illustration/colored_stencil, vector_illustration/thin, vector_illustration/mosaic, vector_illustration/flat_2

Available sizes: 1024x1024, 1024x1536, 1536x1024

result = client.generate_logo(
    "minimalist coffee shop logo with a steaming cup",
    model="v3",
    num_variants=4,
    colors=["#6f4e37", "#f5f5dc"],
)

for i, logo in enumerate(result.logos):
    logo.save(f"logo_{i}.svg")

Generate Pattern

result = client.generate_pattern(
    "tropical leaves and flowers",
    colors=["#2d5016", "#ff6b6b", "#ffd93d"],
)
print(result.image_url)

Batch Processing

result = client.batch([
    {"url": "https://example.com/photo1.png", "operation": "vectorize"},
    {"url": "https://example.com/photo2.jpg", "operation": "remove_bg"},
    {"url": "https://example.com/photo3.png", "operation": "upscale"},
])

for item in result.results:
    if item.success:
        print(f"[{item.index}] {item.operation}: {item.url}")
    else:
        print(f"[{item.index}] Failed: {item.error}")

print(f"Processed: {result.total_processed}, Failed: {result.total_failed}")

Environment Variable

Instead of passing the API key directly, you can set it as an environment variable:

export VECTOSOLVE_API_KEY="vs_your_api_key"
client = VectoSolve()  # Automatically reads VECTOSOLVE_API_KEY

Error Handling

from vectosolve import (
    VectoSolve,
    AuthenticationError,
    InsufficientCreditsError,
    RateLimitError,
    ValidationError,
)

client = VectoSolve(api_key="vs_your_api_key")

try:
    result = client.vectorize("image.png")
except AuthenticationError:
    print("Invalid API key")
except InsufficientCreditsError as e:
    print(f"Need {e.required} credits — top up at vectosolve.com/pricing")
except RateLimitError as e:
    print(f"Rate limited — retry after {e.retry_after}s")
except ValidationError as e:
    print(f"Bad request: {e.message}")

Context Manager

with VectoSolve(api_key="vs_your_api_key") as client:
    result = client.vectorize("photo.png")
    result.save("output.svg")
# Connection automatically closed

Use Cases

  • Cricut & Silhouette — Convert designs to cut-ready SVGs
  • Laser cutting — Vectorize artwork for laser engravers
  • Embroidery — Convert images for embroidery machines
  • E-commerce — Remove backgrounds from product photos
  • Design automation — Generate logos and patterns programmatically

License

MIT

Metadata

Release files for vectosolve 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vectosolve 1.0.1
File Size Uploaded
vectosolve-1.0.1.tar.gz 10.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vectosolve 1.0.1
File Interpreter ABI Platform
vectosolve-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.0 kB

Release files / vectosolve-1.0.1.tar.gz

Download URL vectosolve-1.0.1.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
84859fdf1fb3246680d152b23f79405f3d61b2498d000970124bdf7a30b793f4
BLAKE2b-256 checksum
How to use checksums
18f925ae80ecfda406f5b03c2da65a17bdb094c4d9528b726999b33abcacc5ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / vectosolve-1.0.1-py3-none-any.whl

Download URL vectosolve-1.0.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e28a511b1e2fedd3fa8b19e0a2891bdfb897ea380b016d6fb508467120db75b
BLAKE2b-256 checksum
How to use checksums
4ffb8d7dd63317f384427edb0f0ceb3d1457af8a84c7b79f316ad64deec6ad26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page