Skip to main content

Operations

Operations are executed in the order they are listed in the operations array. The following operations are available:

OperationDescription
bg_removeRemove background from the image. See Background Removal for parameter details.
bg_addAdd a background color or image behind the asset.
border_addAdd a border image around the asset.
graphics_addOverlay one or more graphic images on top of the asset.

Options for bg_add

ParameterTypeDescription
colorstring(optional) Background color (e.g., "#ffffff"). Does not apply for border_add.
image_idstring(optional) Asset ID of the image to use as background.
modestring(optional) "as-is" to use the background image as-is, or "stretch" to stretch it to fit. Defaults to "stretch".
sizeJSON(optional) Background size as { "width": ..., "height": ... }.

Options for border_add

ParameterTypeDescription
image_idstringAsset ID of the border image to use.

Options for graphics_add

A list of graphics can be added to the image. Each graphic is of type image and is positioned using coordinates.

ParameterTypeDescription
image_urlstring(optional, if image_id is supplied) URL of the image to overlay.
image_idstring(optional, if image_url is supplied) Asset ID of the image to overlay.
colorstring(optional) Background color for the graphic element.
positionJSONPosition of the graphic as { "x": ..., "y": ... }.
sizeJSONSize of the graphic as { "width": ..., "height": ... }.