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": "product-photo.jpg",
"url": "https://example.com/product-photo.jpg"
},
"operations": [
{ "type": "resize", "width_in_px": 1000, "height_in_px": 1000, "fit": "contain" },
{ "type": "auto_contrast" },
{ "type": "sharpen", "sigma": 1.5 },
{ "type": "convert", "format": "webp", "quality": 85 }
]
}'
import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.transform({
file: {
type: "url",
name: "product-photo.jpg",
url: "https://example.com/product-photo.jpg",
},
operations: [
{ type: "resize", width_in_px: 1000, height_in_px: 1000, fit: "contain" },
{ type: "auto_contrast" },
{ type: "sharpen", sigma: 1.5 },
{ type: "convert", format: "webp", quality: 85 },
],
});
const imageBuffer = Buffer.from(result.data.buffer, "base64");
import base64
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.transform(
file={
"type": "url",
"name": "product-photo.jpg",
"url": "https://example.com/product-photo.jpg",
},
operations=[
{"type": "resize", "width_in_px": 1000, "height_in_px": 1000, "fit": "contain"},
{"type": "auto_contrast"},
{"type": "sharpen", "sigma": 1.5},
{"type": "convert", "format": "webp", "quality": 85},
],
)
with open("result.webp", "wb") as f:
f.write(base64.b64decode(result["data"]["buffer"]))
package main
import il "github.com/iterationlayer/sdk-go"
client := il.NewClient("YOUR_API_KEY")
result, err := client.Transform(il.TransformRequest{
File: il.NewFileFromURL("product-photo.jpg", "https://example.com/product-photo.jpg"),
Operations: []il.TransformOperation{
il.NewResizeOperation(1000, 1000, "contain"),
{Type: "auto_contrast"},
il.NewSharpenOperation(1.5),
il.NewConvertOperation("webp"),
},
})