Take a pixel art sprite you already have and get themed variants back: same sprite, new surface finish. Ice, lava, gold, moss, neon. Output dimensions always equal input dimensions, so variants drop into your game as palette-swap-grade replacements.
403 not_entitled. Credits still come from the top-up bucket.| Field | Type | Notes |
|---|---|---|
| image_b64 | string, required | Must be pixel art, max 320px per axis of logical pixels. Pre-upscaled art (e.g. a 32px sprite exported at 640px) is detected and handled |
| themes | list of strings | One theme per variant, e.g. ["molten lava", "arctic ice", "royal gold"]. Fewer themes than variants? The empty spots get curated random picks. Themes work best as SURFACE finishes, not objects: "molten lava" reskins, "a dragon" morphs |
| description | string | Single theme applied to every variant. Used when themes is absent |
| variants | int | 1 to 11, default 4 |
| quality | string | epic (default) or mythic |
| match_silhouette | bool | Default false. True snaps every variant's alpha exactly to the source silhouette: guaranteed identical footprint, at the cost of flatter growth-style themes (flames, vines) |
Python:
import base64, requests
img = base64.b64encode(open("sword_32.png", "rb").read()).decode()
r = requests.post(
"https://spritelab.dev/api/v1/reskin",
headers={"Authorization": "Bearer sl_live_YOUR_KEY"},
json={"image_b64": img, "themes": ["molten lava", "arctic ice"], "variants": 2},
)
r.raise_for_status()
out = r.json()
for v in out["variants"]:
name = v["theme"].replace(" ", "_")
open(f"sword_{name}.png", "wb").write(base64.b64decode(v["image_b64"]))
Response envelope:
{
"mode": "reskin",
"source_b64": "…", # the normalised source the variants align to
"width": 32, "height": 32,
"variants": [
{"image_b64": "…", "theme": "molten lava", "width": 32, "height": 32},
{"image_b64": "…", "theme": "arctic ice", "width": 32, "height": 32}
],
"failed": 0, # failed variants are refunded automatically
"cost": 4, # what was actually charged after refunds
"credits_remaining": 370
}
"failed": 2.400 bad_image before any credits are charged.