API DOCS OPEN APP
← API OVERVIEW

Quick Convert

Any image in, clean pixel art out. A faithful redraw: subject, composition, colours and proportions stay true to the input.

POST /convert

POST /api/v1/convert 3 CR
FieldTypeNotes
image_b64string, requiredBase64 (or data URL) PNG, JPG or WebP. Max 10MB decoded, 4096px per axis
remove_backgroundboolDefault true: transparent sprite. false: the redraw keeps the original background (opaque output)
heightint16 to 512, default 128. Output sprite height; width follows the source aspect
size_modestringexact (default), native (the redraw's own pixel size, crispest) or crisp. See Pixel size and cleanup
cleanupstringadvanced (default) or classic. With remove_background: false the classic cleanup is always used
…plus any of the tuning parameters

Python:

import base64, requests

img = base64.b64encode(open("product_photo.jpg", "rb").read()).decode()
r = requests.post(
    "https://spritelab.dev/api/v1/convert",
    headers={"Authorization": "Bearer sl_live_YOUR_KEY"},
    json={"image_b64": img, "height": 96},
)
r.raise_for_status()
out = r.json()
open("pixel.png", "wb").write(base64.b64decode(out["image_b64"]))
print(out["width"], "x", out["height"], "| credits left:", out["credits_remaining"])

Response envelope:

{
  "id": "a3f2…",            # history row id, feed it to /resize
  "mode": "convert",
  "image_b64": "…",
  "width": 64, "height": 96,
  "cleanup": "advanced",    # the cleanup that ran
  "native_height": 48,      # the redraw's own pixel size (size_mode native)
  "native_width": 32,
  "scale": 0,               # 0 = exact height, else the whole-number multiple
  "cost": 3,
  "credits_remaining": 377
}

Iterating for free

The conversion itself costs 3 credits; everything after is free. Pass the returned id to POST /resize with new dimensions or tuning (palette lock, outline, colour count) and the pipeline re-runs against the saved conversion without another model call.