Bildskalierung
Suradil
Algorithmische Kantenerweiterung — skaliert Bilder auf beliebige Zielgrößen mit Stretch- oder Mirror-Algorithmus.
Preise
Bildskalierung
pro 1024×1024 Block
Berechnung
ceil(width × height / 1.048.576)Beispiele
750×4001 Block1920×10802 Blöcke4096×21609 BlöckePOST
/v1/suradil/resizeSkaliert ein Bild auf eine Zielgröße und erweitert die Ränder intelligent. Antwort: PNG (Base64).
Parameter
imagestringJaQuellbild — JPEG, PNG, WebP, TIFF, GIF (URL, Base64 oder Data URI)
target_widthintegerJaZielbreite in Pixel (max. 8192)
target_heightintegerJaZielhöhe in Pixel (max. 8192)
use_mirrorbooleanOptionalMirror-Modus statt Stretch (Standard: 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
}
}