Background
The background section contains all background properties, such as removing the background and setting the color.
Remove image background. This operation offers both fully automated mode and advanced manual options. Following is a description of
remove
option.Possible values:
Value | Type | Description |
---|---|---|
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
:Option | Type | Description |
---|---|---|
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:
|
clipping | boolean | false by default. If true , image is clipped to the foreground object bounds. Resulting image canvas is controlled by the resizing block. |
Simple background removal
Advanced: category
Advanced: clipping and color
JSON Request
"operations": {
"background": {
"remove": true
}
}

"operations": {
"background": {
"remove": {
"category": "products"
}
}
}

"operations": {
"background": {
"remove": {
"category": {
"type": "products",
"version": "2"
}
}
}
}

"operations": {
"background": {
"remove": {
"category": "cars"
}
}
}

The image background. You can set transparent background or any color in hexadecimal format.
Possible values
Value | Type | Description |
---|---|---|
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
Transparent
Color
"operations": {
"background": {
"remove": {
"category": "products"
},
"color": "transparent"
}
}

"operations": {
"background": {
"remove": {
"category": "products"
},
"color": "#C5C6FF"
}
}

Blur image background. This operation offers both fully automated mode and advanced manual options. Here's a descritption of
blur
option.Possible values:
Value | Type | Description |
---|---|---|
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 option | Type | Description |
---|---|---|
category | string | Provides a hint about the nature of object in the foreground for a more accurate result of background blurring. Possible values:
|
type | string | Selects the type of blur to be applied to the background. Possible values:
|
level | string | Selects the level of blur strength to be applied to the background. Possible values:
|
JSON Request
Simple background blurring
Advanced: category
Advanced: type
Advanced: level
"operations": {
"background": {
"blur": true
}
}

"operations": {
"background": {
"blur": {
"category": "cars",
"type": "lens",
"level": "low"
}
}
}

"operations": {
"background": {
"blur": {
"category": "cars",
"type": "lens",
"level": "medium"
}
}
}

"operations": {
"background": {
"blur": {
"category": "cars",
"type": "lens",
"level": "high"
}
}
}

Last modified 2mo ago