S
spritesynthDOCS

Resize

Smart resize with algorithm choice for pixel art.

Resize

Resize pixel art images with algorithm-appropriate interpolation. Choose from nearest neighbor (pixel-perfect), bilinear, or bicubic scaling.

Endpoint

POST /api/image-ops/resize

Parameters

NameTypeRequiredDescription
imagestringYesImage URL or base64-encoded image data
sizestringYesTarget dimensions as WxH (e.g. 256x256)
algorithmstringNoResizing algorithm. Default: nearest_neighbor

Algorithm Options

AlgorithmUse Case
nearest_neighborPixel-perfect scaling, preserves sharp edges
bilinearSmoother scaling, slight blur at edges
bicubicHigh-quality smooth scaling

Example

curl -X POST https://api.spritesynth.com/api/image-ops/resize \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://example.com/small-sprite.png",
    "size": "256x256",
    "algorithm": "nearest_neighbor"
  }'

Response

{
  "id": "resize_567",
  "status": "completed",
  "asset": {
    "url": "https://cdn.spritesynth.com/assets/resize_567.png",
    "width": 256,
    "height": 256
  },
  "credits_cost": 1,
  "duration_ms": 400
}

Tips

  • Always use nearest_neighbor for pixel art to preserve sharp edges.
  • Use bilinear or bicubic only for smooth artwork or anti-aliased images.
  • Upscaling with nearest neighbor maintains the pixel-art aesthetic.

Need help?

Join our Discord community for support and tips.
Was this page helpful?

On this page