Search
K

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:
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:
  • "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.
Simple background removal
Advanced: category
Advanced: clipping and color
JSON Request
"operations": {
"background": {
"remove": true
}
}

Category: Products

JSON Request

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

Category: Products, version 2

JSON Request

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

Category: Cars

JSON Request

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

JSON Request

"operations": {
"background": {
"remove": {
"category": "products",
"clipping": true
},
"color": "transparent"
}
}
JSON Request

Background color

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"
}
}

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:
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:
  • "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
Simple background blurring
Advanced: category
Advanced: type
Advanced: level
"operations": {
"background": {
"blur": true
}
}

Category: Products

JSON Request

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

Category: Cars

JSON Request

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

Type: Regular

JSON Request

"operations": {
"background": {
"blur": {
"category": "cars",
"type": "regular"
}
}
}

Type: Lens

JSON Request

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

Level: low

JSON Request

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

Level: medium

JSON Request

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

Level: high

JSON Request

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