Optimize Product Photos

Resize, enhance, and compress product photos for e-commerce listings with consistent quality.

Who this is for

E-commerce teams and marketplace sellers use this recipe to prepare product photos for listings. Upload a raw product photo and apply a pipeline of resize, auto-contrast, sharpen, and format conversion — ready for your storefront with consistent quality and fast load times.

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"),
    },
})

Related Recipes

Start building in minutes

Free trial credits included. No credit card required.