Image Editing

Crop, reframe, and add text overlays to images.


POST/api/v1/image/edit

Request Body

ParameterTypeRequiredDescription
operationstringYes"imageCrop" or "textOverlay"
mediaIdsstring[]Yes1 media ID of the image to edit
promptTextstringNoText content for textOverlay operation

imageCrop

Crop an image by specifying pixel coordinates, an aspect ratio, or both.

ParameterTypeRequiredDescription
cropPixelXintegerNoX coordinate of the crop origin
cropPixelYintegerNoY coordinate of the crop origin
cropPixelWidthintegerNoWidth of the crop area in pixels
cropPixelHeightintegerNoHeight of the crop area in pixels
aspectRatiostringNo16: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).

ParameterTypeRequiredDescription
positionstringNotop-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right
paddingTopnumberNoTop padding as % of canvas height (0-50)
paddingRightnumberNoRight padding as % of canvas width (0-50)
paddingBottomnumberNoBottom padding as % of canvas height (0-50)
paddingLeftnumberNoLeft padding as % of canvas width (0-50)
sizePercentnumberNoText container width as % of canvas (10-100, default 66)
fontFamilystringNoInter, 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
fontSizeScalenumberNoFont size multiplier (0.3-3, default 0.5)
textColorstringNoHex color for the text (default #FFFFFF)
strokeColorstringNoHex color for the text stroke (default #000000)
strokeWidthnumberNoStroke width (0-20, default 4.5)
highlightColorstringNoHex color for the text highlight
showShadowbooleanNoShow 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
  }
}