Guides

Asset Options

Multiple assets can be passed in the request. Each asset can have its own options for canvas size and initial fill color. The options for each asset are as below.

ParameterTypeDescription
canvasJSON(optional) Canvas options for the image. Canvas is optional if bg_add is specified
colorstring(optional) Color to applied to the canvas on initialization. If not provided, it is set to transparent color.
sizeJSON(optional) Size of the graphics to be added to the image. The size is specified as a JSON object with width and height.
cropJSON(optional) Crop dimensions to be applied to the image. The crop dimensions are specified as JSON object with left, top, right, bottom.
positionJSON(optional) Position of the image asset on the canvas. The position is specified as a JSON object with x and y coordinates. Defaults to the center of the Canvas.
disposition.create_assetBooleanSpecifies if the output video should be added as an asset. Default to false
disposition.add_as_conversionBooleanIf true, outputs are added as conversions to the original asset. If false, each output is added as a new asset (consider setting inherit_metadata to true in this case)
disposition.conversion_namestringName to use when adding as conversion to asset, must follow conversion name specification (30 characters max, can only be alphanumeric, spaces are not allowed), not needed if add_as_conversion is false. If add_as_conversion is true, this is mandatory.
disposition.modeStringMode of adding metadata to the new asset. Can be APPEND or REPLACE
disposition.data_schema_idIntegerAsset Schema id of the metadata to be added to the new asset
disposition.metadataJSON(optional) Specifies asset metadata
disposition.metadata .inheritBooleanWhether the new_asset created should inherit all metadata of parent asset
disposition.metadata .src_asset_idStringAsset ID of the original asset whose metadata is to be inherited
disposition.metadata .inherit_fieldsList(String)Metadata keys of original asset to be inherited
disposition.metadata.dataJSONMetadata to be added to the new asset

Note:

  • if crop options is provided:-

    • crop dimensions ( left, top, right, bottom ) must be with respect to the original image size associated with asset id. For example, if original asset has a size of 2000x2000, crop of [left:0, top:0, right:100, bottom:200] will crop to this region in the original image. Note that invalid crop parameters will result in incorrect outputs.
    • original asset is retrieved and cropped and the cropped image is then used in all processing operations.
  • if add_as_conversion is set to true, the conversion_name must follow the conversion name specification. metadata will be ignored.

  • if add_as_conversion is set to false, conversion_name will be ignored. metadata field if provided will be used to add metadata to the new asset. If metadata is not provided, the new asset will not have any metadata.

  • If inherit is set to true, all source asset custom metadata fields (including data_scheme_id) will be inherited if inherit_fields field is not provided. If inherit is set to false, the data field will be used to add metadata to the new asset.

  • If inherit is set to false and data field is not provided, the new asset will not have any metadata.