Background

The background section contains all background properties, such as removing the background and setting the color.

Background removal

Remove image background. This operation offers both fully automated mode and advanced manual options. Following is a description of remove option.

Possible values:

ValueTypeDescription

true

boolean

Removes image background.

false

boolean

Default. Keeps the background of the original image intact.

{ "category": "general", "clipping": true }

object

Advanced options for background removal. See detailed description in the table below.

Below are advanced options supported by remove:

OptionTypeDescription

category

string or object

Provides a hint about the nature of object in the foreground for a more accurate result of background removal. Possible values:

  • "general" is suitable for all objects and is used by default.

  • "products" or {"type": "products", "version": "1"} is the advanced category that will have better results with product, grocery and food objects.

  • {"type": "products", "version": "2"} is the advanced category for the same types of objects as the previous version, but does a better job of handling complex shapes with jagged edges or holes.

  • "cars" is the advanced category that will have better results with automotive objects.

clipping

boolean

false by default. If true, image is clipped to the foreground object bounds. Resulting image canvas is controlled by the resizing block.

JSON Request

"operations": {
    "background": {
        "remove": true
    }
}

Background color

The image background. You can set transparent background or any color in hexadecimal format.

Possible values

ValueTypeDescription

transparent

string

To set transparent background the image format should support an alpha channel (PNG, WEBP or AVIF) otherwise the background will be white.

color

string

Set the color of the background in hexadecimal format. Default is white color.

JSON Request

"operations": {
    "background": {
        "remove": {
            "category": "products"
        },
        "color": "transparent"
    }
}

Background blurring

Blur image background. This operation offers both fully automated mode and advanced manual options. Here's a descritption of blur option.

Possible values:

ValueTypeDescription

true

boolean

Blurs image background

false

boolean

Default. Keeps the background of the original image intact.

{ "category": "general", "type": "regular", "level": "medium" }

object

Advanced options for background blurring. See detailed description in the table below.

Below are advanced options supported by blur:

Advanced optionTypeDescription

category

string

Provides a hint about the nature of object in the foreground for a more accurate result of background blurring. Possible values:

  • "general" is suitable for all objects and is used by default.

  • "products"is the advanced category that will have better results with product, grocery and food objects.

  • "cars" is the advanced category that will have better results with automotive objects.

type

string

Selects the type of blur to be applied to the background.

Possible values:

  • "regular" is for gaussian blur type. Creates an effect of laying a translucent material like vellum on top of the image background. It is used as default parameter.

  • "lens"is for lens blur type with linear focus. Mimics the blur applied to a photo when a wide aperture is used to achieve a narrow depth of field, so that the foreground objects stands out.

level

string

Selects the level of blur strength to be applied to the background. Possible values:

  • "low" is for low blur strength.

  • "medium" is for medium blur strength. It is used as default parameter.

  • "high" is for high blur strength.

JSON Request

"operations": {
    "background": {
        "blur": true
    }
}

Last updated