Intelligent Image Scaling
Suradil
Algorithmic edge extension — scales images to any target size using stretch or mirror algorithm.
Pricing
25Credits
Image Scalingper 1024×1024 block
Calculation
ceil(width × height / 1.048.576)Examples
750×4001 Block1920×10802 Blocks4096×21609 BlocksPOST
/v1/suradil/resizeScales an image to a target size and intelligently extends the edges. Response: PNG (Base64).
Parameter
| Name | Type | Status | Description |
|---|---|---|---|
image | string | Yes | Source image — JPEG, PNG, WebP, TIFF, GIF (URL, Base64 or Data URI) |
target_width | integer | Yes | Target width in pixels (max 8192) |
target_height | integer | Yes | Target height in pixels (max 8192) |
use_mirror | boolean | Optional | Mirror mode instead of stretch (default: false) |
Request
curl -X POST "https://api.centra.dbpg.io/v1/suradil/resize" \
-H "Authorization: Bearer sk-live-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
}
}