Image Editing
Crop, reframe, and add text overlays to images.
POST
/api/v1/image/editRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | "imageCrop" or "textOverlay" |
| mediaIds | string[] | Yes | 1 media ID of the image to edit |
| promptText | string | No | Text content for textOverlay operation |
imageCrop
Crop an image by specifying pixel coordinates, an aspect ratio, or both.
| Parameter | Type | Required | Description |
|---|---|---|---|
| cropPixelX | integer | No | X coordinate of the crop origin |
| cropPixelY | integer | No | Y coordinate of the crop origin |
| cropPixelWidth | integer | No | Width of the crop area in pixels |
| cropPixelHeight | integer | No | Height of the crop area in pixels |
| aspectRatio | string | No | 16:9, 9:16, 1:1, 4:5, 21:9, 4:3, 3:2, free (default free) |
Response
{
"editorJobId": "ej_..."
}Example
POST
/api/v1/image/edit{
"operation": "imageCrop",
"mediaIds": ["media_abc"],
"params": {
"aspectRatio": "1:1",
"cropPixelX": 100,
"cropPixelY": 50,
"cropPixelWidth": 500,
"cropPixelHeight": 500
}
}textOverlay
Add text on top of an image. Output format matches the input (JPEG in → JPEG out, PNG in → PNG out). Same parameters as video textOverlay (except duration-related fields which don't apply to images).
| Parameter | Type | Required | Description |
|---|---|---|---|
| position | string | No | top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right |
| paddingTop | number | No | Top padding as % of canvas height (0-50) |
| paddingRight | number | No | Right padding as % of canvas width (0-50) |
| paddingBottom | number | No | Bottom padding as % of canvas height (0-50) |
| paddingLeft | number | No | Left padding as % of canvas width (0-50) |
| sizePercent | number | No | Text container width as % of canvas (10-100, default 66) |
| fontFamily | string | No | Inter, Montserrat, Bebas Neue, Oswald, Bungee Inline, League Spartan, Roboto, Poppins, Raleway, Anton, Darker Grotesque, TikTok Sans, TikTok Sans Condensed, TikTok Sans SemiCondensed, TikTok Sans SemiExpanded, TikTok Sans Expanded, TikTok Sans ExtraExpanded, Nohemi, Comic Cat, Gavency |
| fontSizeScale | number | No | Font size multiplier (0.3-3, default 0.5) |
| textColor | string | No | Hex color for the text (default #FFFFFF) |
| strokeColor | string | No | Hex color for the text stroke (default #000000) |
| strokeWidth | number | No | Stroke width (0-20, default 4.5) |
| highlightColor | string | No | Hex color for the text highlight |
| showShadow | boolean | No | Show drop shadow behind text |
Example
{
"operation": "textOverlay",
"mediaIds": ["media_abc"],
"promptText": "Hello World!",
"params": {
"position": "center",
"fontFamily": "TikTok Sans SemiCondensed",
"textColor": "#FFFFFF",
"strokeColor": "#000000",
"strokeWidth": 4.5
}
}