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": "upload.jpg",
"url": "https://cdn.example.com/uploads/user-photo.jpg"
},
"operations": [
{
"type": "smart_crop",
"width_in_px": 256,
"height_in_px": 256
},
{
"type": "remove_background"
},
{
"type": "convert",
"format": "webp",
"quality": 85
}
]
}'{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUg...",
"mime_type": "image/webp"
}
}import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.transform({
file: {
type: "url",
name: "upload.jpg",
url: "https://cdn.example.com/uploads/user-photo.jpg",
},
operations: [
{
type: "smart_crop",
width_in_px: 256,
height_in_px: 256,
},
{ type: "remove_background" },
{
type: "convert",
format: "webp",
quality: 85,
},
],
});{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUg...",
"mime_type": "image/webp"
}
}from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.transform(
file={
"type": "url",
"name": "upload.jpg",
"url": "https://cdn.example.com/uploads/user-photo.jpg",
},
operations=[
{
"type": "smart_crop",
"width_in_px": 256,
"height_in_px": 256,
},
{"type": "remove_background"},
{
"type": "convert",
"format": "webp",
"quality": 85,
},
],
){
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUg...",
"mime_type": "image/webp"
}
}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(
"upload.jpg",
"https://cdn.example.com/uploads/user-photo.jpg",
),
Operations: []il.TransformOperation{
il.NewSmartCropOperation(256, 256),
il.NewRemoveBackgroundOperation(),
il.NewConvertOperation("webp", 85),
},
})
if err != nil {
panic(err)
}
}{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUg...",
"mime_type": "image/webp"
}
}