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": "hero.jpg",
"url": "https://cdn.example.com/campaign/hero.jpg"
},
"operations": [
{
"type": "resize",
"width_in_px": 1200,
"height_in_px": 900,
"fit": "inside"
},
{
"type": "sharpen",
"sigma": 0.5
},
{
"type": "convert",
"format": "jpeg",
"quality": 85
},
{
"type": "compress_to_size",
"max_file_size_in_bytes": 500000
}
]
}'Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQAAAQ...",
"mime_type": "image/jpeg"
}
}Request
import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.transform({
file: {
type: "url",
name: "hero.jpg",
url: "https://cdn.example.com/campaign/hero.jpg",
},
operations: [
{
type: "resize",
width_in_px: 1200,
height_in_px: 900,
fit: "inside",
},
{
type: "sharpen",
sigma: 0.5,
},
{
type: "convert",
format: "jpeg",
quality: 85,
},
{
type: "compress_to_size",
max_file_size_in_bytes: 500_000,
},
],
});Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQAAAQ...",
"mime_type": "image/jpeg"
}
}Request
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.transform(
file={
"type": "url",
"name": "hero.jpg",
"url": "https://cdn.example.com/campaign/hero.jpg",
},
operations=[
{
"type": "resize",
"width_in_px": 1200,
"height_in_px": 900,
"fit": "inside",
},
{
"type": "sharpen",
"sigma": 0.5,
},
{
"type": "convert",
"format": "jpeg",
"quality": 85,
},
{
"type": "compress_to_size",
"max_file_size_in_bytes": 500_000,
},
],
)Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQAAAQ...",
"mime_type": "image/jpeg"
}
}Request
package main
import il "github.com/iterationlayer/sdk-go"
func main() {
client := il.NewClient("YOUR_API_KEY")
result, err := client.Transform(il.TransformRequest{
File: il.NewFileFromURL(
"hero.jpg",
"https://cdn.example.com/campaign/hero.jpg",
),
Operations: []il.TransformOperation{
il.NewResizeOperation(1200, 900, "inside"),
il.NewSharpenOperation(0.5),
il.NewConvertOperation("jpeg"),
il.NewCompressToSizeOperation(500_000),
},
})
if err != nil {
panic(err)
}
}Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQAAAQ...",
"mime_type": "image/jpeg"
}
}