Operations are executed in the order they are listed in the operations array. The following operations are available:
| Operation | Description |
|---|
bg_remove | Remove background from the image. See Background Removal for parameter details. |
bg_add | Add a background color or image behind the asset. |
border_add | Add a border image around the asset. |
graphics_add | Overlay one or more graphic images on top of the asset. |
Options for bg_add
| Parameter | Type | Description |
|---|
color | string | (optional) Background color (e.g., "#ffffff"). Does not apply for border_add. |
image_id | string | (optional) Asset ID of the image to use as background. |
mode | string | (optional) "as-is" to use the background image as-is, or "stretch" to stretch it to fit. Defaults to "stretch". |
size | JSON | (optional) Background size as { "width": ..., "height": ... }. |
Options for border_add
| Parameter | Type | Description |
|---|
image_id | string | Asset 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.
| Parameter | Type | Description |
|---|
image_url | string | (optional, if image_id is supplied) URL of the image to overlay. |
image_id | string | (optional, if image_url is supplied) Asset ID of the image to overlay. |
color | string | (optional) Background color for the graphic element. |
position | JSON | Position of the graphic as { "x": ..., "y": ... }. |
size | JSON | Size of the graphic as { "width": ..., "height": ... }. |