Resize, sharpen, and compress an image to fit email platform size limits in a single pipeline.
日本語の概要は準備中です。原文の説明を表示しています。
Transform images with resize, crop, smart crop, upscale, remove background, and 20+ operations.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Transform images with resize, crop, smart crop, upscale, remove background, and 20+ operations.
Cost: 0.5 credits per request
You need an Iteration Layer API key. Get one at platform.iterationlayer.com during the 7-day trial.
For full integration guidance (SDKs, auth, MCP, error handling), see the Iteration Layer Integration Guide.
Transform images with a single API call. Send a file and an ordered list of operations — resize, crop, blur, sharpen, convert, and more — and receive the transformed image as base64-encoded JSON in the response.
The Image Transformation API applies a pipeline of operations to an image. You send a file (base64 or URL) and an ordered list of operations, and receive the transformed image as base64-encoded JSON in the response.
Endpoint: POST /image-transformation/v1/transform
Supported formats: JPEG, PNG, WebP, GIF, AVIF, HEIF, SVG
Limits:
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": "base64",
"name": "photo.jpg",
"base64": "<base64-encoded-image>"
},
"operations": [
{
"type": "resize",
"width_in_px": 800,
"height_in_px": 600,
"fit": "cover"
},
{
"type": "convert",
"format": "webp",
"quality": 85
}
]
}'
import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({
apiKey: "YOUR_API_KEY",
});
const result = await client.transformImage({
file: {
type: "base64",
name: "photo.jpg",
base64: new Uint8Array([/* image bytes */]),
},
operations: [
{
type: "resize",
width_in_px: 800,
height_in_px: 600,
fit: "cover",
},
{
type: "convert",
format: "webp",
quality: 85,
},
],
});
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.transform_image(
file={
"type": "base64",
"name": "photo.jpg",
"base64": b"...",
},
operations=[
{
"type": "resize",
"width_in_px": 800,
"height_in_px": 600,
"fit": "cover",
},
{
"type": "convert",
"format": "webp",
"quality": 85,
},
],
)
import il "github.com/iterationlayer/sdk-go"
client := il.NewClient("YOUR_API_KEY")
result, err := client.TransformImage(il.TransformImageRequest{
File: il.FileInput{Type: "base64", Name: "photo.jpg", Base64: []byte{ /* image bytes */ }},
Operations: []il.TransformOperation{
il.NewResizeOperation(800, 600, "cover"),
il.NewConvertOperation("webp"),
},
})
<!-- response -->
{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/webp"
}
}
<!-- /tabs -->
| Field | Type | Required | Description |
|---|---|---|---|
file | object | Yes | Image file to transform (see File Input below) |
operations | array | Yes | Ordered list of operations to apply (max 30) |
webhook_url | string | No | HTTPS URL to receive results asynchronously. If provided, returns 201 immediately. See Webhooks. |
Add a webhook_url parameter to process the request in the background. The API returns 201 Accepted immediately and delivers the result to your webhook URL when processing completes. See Webhooks for payload format and retry behavior.
Provide the image as either base64 or a URL:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Filename with extension (e.g., photo.jpg) |
base64 | string | One of base64/url | Base64-encoded file content |
url | string | One of base64/url | HTTPS URL to fetch the file from. HTTP is not accepted. |
{
"file": {
"name": "photo.jpg",
"url": "https://example.com/photo.jpg"
},
"operations": [
{
"type": "grayscale"
}
]
}
Operations are applied sequentially in the order provided.
Resize the image to target dimensions.
| Field | Type | Required | Description |
|---|---|---|---|
width | integer | Yes | Target width (> 0) |
height | integer | Yes | Target height (> 0) |
fit | string | Yes | One of: cover, contain, fill, inside, outside |
Fit modes:
cover — Scale and crop to fill the target dimensions exactlycontain — Scale to fit within dimensions, padding with blackfill — Stretch to fill dimensions (may distort)inside — Scale down only if larger than targetoutside — Scale up only if smaller than target{
"type": "resize",
"width_in_px": 400,
"height_in_px": 300,
"fit": "cover"
}
Extract a rectangular region from the image.
| Field | Type | Required | Description |
|---|---|---|---|
left_in_px | integer | Yes | Left offset (>= 0) |
top_in_px | integer | Yes | Top offset (>= 0) |
width | integer | Yes | Crop width (> 0) |
height | integer | Yes | Crop height (> 0) |
{
"type": "crop",
"left_in_px": 100,
"top_in_px": 50,
"width_in_px": 400,
"height_in_px": 300
}
Intelligent crop that centers on detected objects (faces, people, animals). Falls back to center crop when no objects are detected. Uses AI object detection.
| Field | Type | Required | Description |
|---|---|---|---|
width | integer | Yes | Target width (> 0) |
height | integer | Yes | Target height (> 0) |
Priority order: face > person > animal > object
{
"type": "smart_crop",
"width_in_px": 300,
"height_in_px": 300
}
Add padding around the image with a background color.
| Field | Type | Required | Description |
|---|---|---|---|
top_in_px | integer | Yes | Top padding (>= 0) |
bottom_in_px | integer | Yes | Bottom padding (>= 0) |
left_in_px | integer | Yes | Left padding (>= 0) |
right_in_px | integer | Yes | Right padding (>= 0) |
hex_color | string | Yes | Background color (e.g., #FF0000) |
{
"type": "extend",
"top_in_px": 20,
"bottom_in_px": 20,
"left_in_px": 20,
"right_in_px": 20,
"hex_color": "#FFFFFF"
}
Remove borders from the image based on a color similarity threshold.
| Field | Type | Required | Description |
|---|---|---|---|
threshold | integer | Yes | Color difference threshold (>= 0) |
{
"type": "trim",
"threshold": 10
}
Rotate the image by any angle. Non-90-degree rotations expand the canvas.
| Field | Type | Required | Description |
|---|---|---|---|
angle_in_degrees | float | Yes | Rotation angle |
hex_color | string | No | Background color for exposed areas (default: black) |
{
"type": "rotate",
"angle_in_degrees": 45.0,
"hex_color": "#FFFFFF"
}
Mirror the image vertically (top to bottom).
{
"type": "flip"
}
Mirror the image horizontally (left to right).
{
"type": "flop"
}
Apply Gaussian blur.
| Field | Type | Required | Description |
|---|---|---|---|
sigma | float | Yes | Blur radius (> 0) |
{
"type": "blur",
"sigma": 3.0
}
Sharpen the image.
| Field | Type | Required | Description |
|---|---|---|---|
sigma | float | Yes | Sharpen intensity (> 0) |
{
"type": "sharpen",
"sigma": 2.0
}
Adjust brightness, saturation, and/or hue. At least one parameter must be provided.
| Field | Type | Required | Description |
|---|---|---|---|
brightness | float | No | Brightness multiplier (1.0 = unchanged) |
saturation | float | No | Saturation multiplier (1.0 = unchanged) |
hue | float | No | Hue rotation in degrees |
{
"type": "modulate",
"brightness": 1.2,
"saturation": 0.8
}
Apply a color tint to the image.
| Field | Type | Required | Description |
|---|---|---|---|
hex_color | string | Yes | Tint color (e.g., #FF6600) |
{
"type": "tint",
"hex_color": "#FF6600"
}
Convert the image to grayscale.
{
"type": "grayscale"
}
Invert all colors in the image.
{
"type": "invert_colors"
}
Automatically adjust contrast by normalizing the histogram.
{
"type": "auto_contrast"
}
Apply gamma correction.
| Field | Type | Required | Description |
|---|---|---|---|
gamma | float | Yes | Gamma value (> 0, typical: 0.5-3.0) |
{
"type": "gamma",
"gamma": 2.2
}
Flatten the alpha channel against a background color. No-op if the image has no alpha channel.
| Field | Type | Required | Description |
|---|---|---|---|
hex_color | string | Yes | Background color |
{
"type": "remove_transparency",
"hex_color": "#FFFFFF"
}
Convert pixels to black or white based on a brightness threshold.
| Field | Type | Required | Description |
|---|---|---|---|
value | integer | Yes | Threshold value (0-255) |
is_grayscale | boolean | Yes | Convert to grayscale before thresholding |
{
"type": "threshold",
"value": 128,
"is_grayscale": true
}
Reduce noise using a median filter.
| Field | Type | Required | Description |
|---|---|---|---|
size | integer | Yes | Filter window size (> 0, odd numbers recommended) |
{
"type": "denoise",
"size": 3
}
Adjust the image opacity.
| Field | Type | Required | Description |
|---|---|---|---|
opacity_in_percent | integer | Yes | Opacity level (0-100) |
{
"type": "opacity",
"opacity_in_percent": 50
}
Convert the image to a different format.
| Field | Type | Required | Description |
|---|---|---|---|
format | string | Yes | One of: png, jpeg, webp, avif, heif |
quality | integer | No | Compression quality (1-100, for jpeg/webp) |
{
"type": "convert",
"format": "webp",
"quality": 85
}
Upscale the image using AI-powered super resolution.
| Field | Type | Required | Description |
|---|---|---|---|
factor | integer | Yes | Scale factor: 2, 3, or 4 |
{
"type": "upscale",
"factor": 4
}
Iteratively compress an image to fit within a target file size. For lossy formats (JPEG, WebP) reduces quality first, then dimensions. For lossless formats (PNG, GIF) reduces dimensions only.
| Field | Type | Required | Description |
|---|---|---|---|
max_file_size_in_bytes | integer | Yes | Maximum output size in bytes |
{
"type": "compress_to_size",
"max_file_size_in_bytes": 500000
}
Remove the image background using AI segmentation. Isolates the foreground subject and composites against a solid color or produces a transparent result.
The output format matches the input format. For formats that do not support transparency (JPEG, GIF), the background is filled with white unless hex_color is specified. To get a transparent result, convert to PNG or WebP first using the convert operation.
| Field | Type | Required | Description |
|---|---|---|---|
background_hex_color | string | No | Background replacement color (e.g., #FFFFFF). Omit for transparent (PNG/WebP only). |
{
"type": "remove_background"
}
With background color:
{
"type": "remove_background",
"background_hex_color": "#FFFFFF"
}
Transparent output (convert to PNG first if input is JPEG):
[
{
"type": "convert",
"format": "png"
},
{
"type": "remove_background"
}
]
For complete, runnable examples see the Recipes page.
| Status | Description |
|---|---|
| 400 | Invalid request (missing file, invalid operations, unsupported format) |
| 401 | Missing or invalid API key |
| 422 | Processing error (image too small for crop, invalid color, etc.) |
| 429 | Rate limit exceeded |
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Resize, sharpen, and compress an image to fit email platform size limits in a single pipeline.
日本語の概要は準備中です。原文の説明を表示しています。
Compress an image to fit within a specific file size in bytes using quality-first compression.
日本語の概要は準備中です。原文の説明を表示しています。
Convert a contract PDF to clean markdown for clause extraction or LLM analysis.
日本語の概要は準備中です。原文の説明を表示しています。
Convert external documents — specs, contracts, reports — to markdown for knowledge base ingestion.
日本語の概要は準備中です。原文の説明を表示しています。
Convert a document to clean markdown suitable for chunking and embedding in a RAG pipeline.
日本語の概要は準備中です。原文の説明を表示しています。
Convert an image between PNG, JPEG, and WebP formats with quality control for web optimization.
日本語の概要は準備中です。原文の説明を表示しています。