Request
curl -X POST https://api.iterationlayer.com/image-transformation/v1/transform \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file": {
"type": "url",
"name": "low-res-image.jpg",
"url": "https://example.com/low-res-image.jpg"
},
"operations": [
{ "type": "upscale", "factor": 4 },
{ "type": "convert", "format": "png" }
]
}'Response
{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
}Request
import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.transform({
file: {
type: "url",
name: "low-res-image.jpg",
url: "https://example.com/low-res-image.jpg",
},
operations: [
{ type: "upscale", factor: 4 },
{ type: "convert", format: "png" },
],
});
const imageBuffer = Buffer.from(result.data.buffer, "base64");Response
{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
}Request
import base64
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.transform(
file={
"type": "url",
"name": "low-res-image.jpg",
"url": "https://example.com/low-res-image.jpg",
},
operations=[
{"type": "upscale", "factor": 4},
{"type": "convert", "format": "png"},
],
)
with open("result.png", "wb") as f:
f.write(base64.b64decode(result["data"]["buffer"]))Response
{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
}Request
package main
import il "github.com/iterationlayer/sdk-go"
client := il.NewClient("YOUR_API_KEY")
result, err := client.Transform(il.TransformRequest{
File: il.NewFileFromURL("low-res-image.jpg", "https://example.com/low-res-image.jpg"),
Operations: []il.TransformOperation{
{Type: "upscale", Factor: 4},
il.NewConvertOperation("png"),
},
})Response
{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
}