Convert Image Formats at Scale

Convert images between PNG, JPEG, and WebP formats with quality control for web optimization.

Who this is for

Web development teams and CDN operators use this recipe to convert images to modern formats like WebP for faster page loads. Upload any image and convert it to your target format with precise quality control — ready for optimized delivery.

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": "image.png",
      "url": "https://example.com/image.png"
    },
    "operations": [
      { "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: "image.png",
    url: "https://example.com/image.png",
  },
  operations: [
    { 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": "image.png",
        "url": "https://example.com/image.png",
    },
    operations=[
        {"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("image.png", "https://example.com/image.png"),
    Operations: []il.TransformOperation{il.NewConvertOperation("webp")},
})

Related Recipes

Start building in minutes

Free trial credits included. No credit card required.