Image resizing

Suradil

Algorithmic edge extension — scales images to any target size using stretch or mirror algorithm.

Pricing

Image Scaling

per 1024×1024 block

25Credits

Calculation

ceil(width × height / 1.048.576)

Examples

750×4001 Block
25 Credits
1920×10802 Blocks
50 Credits
4096×21609 Blocks
225 Credits
POST/v1/suradil/resize

Scales an image to a target size and intelligently extends the edges. Response: PNG (Base64).

Parameter

  • imagestring
    Yes

    Source image — JPEG, PNG, WebP, TIFF, GIF (URL, Base64 or Data URI)

  • target_widthinteger
    Yes

    Target width in pixels (max 8192)

  • target_heightinteger
    Yes

    Target height in pixels (max 8192)

  • use_mirrorbooleanOptional

    Mirror mode instead of stretch (default: false)

Request

curl -X POST "https://api.centra.dbpg.io/v1/suradil/resize" \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://example.com/photo.jpg",
    "target_width": 1920,
    "target_height": 1080
  }'

Response

{
  "image": "iVBORw0KGgoAAAANSUhEUgAA...",
  "format": "png",
  "metadata": {
    "originalWidth": 1600,
    "originalHeight": 400,
    "targetWidth": 1920,
    "targetHeight": 1080
  },
  "usage": {
    "credits_used": 50,
    "remaining_balance": 45000
  }
}