Background
Last updated
Last updated
The background section contains all background properties, such as removing the background, blurring 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:
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.
{ "selective": { "object_to_keep": "<object>" }, "clipping": true }
object
Advanced options for background removal. See detailed description in the table below.
Below are advanced options supported by remove
:
category
string
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.
"products"
is the advanced category that will have better results with product, grocery and food objects. It is used by default.
"cars"
is the advanced category that will have better results with automotive objects.
The category
background removal option is used by default and cannot be used together with selective
.
selective
object
Allows to specify exactly which object should remain on the image, e.g. "food"
, "sleeping bag"
, "product"
, etc. Specifying which object to keep is mandatory and should be short and precise.
The Selective background removal is an alternative to the category
option and cannot be used together.
clipping
boolean
Please be aware that older versions of the products
background removal category will be deprecated and automatically updated to the latest version starting January 1, 2025.
If clipping
is enabled, resizing.fit
value is "crop"/
unspecified, resizing.width
and resizing.height
are also unspecified - the resulting cropped image will be scaled to the dimensions of the input image.
If you want to keep the clipped region unchanged, set resizing.fit
to "bounds"
and leave resizing.width
and resizing.height
unspecified.
You can also upscale or downscale the clipped region in many different ways. See Resizing and Upscale to learn more.
JSON Request
The image background. You can set transparent background or any color in hexadecimal format.
Possible values
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
Blur image background. This operation offers both fully automated mode and advanced manual options. Here's a description of blur
option.
Possible values:
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.
{ "selective": { "object_to_keep": "<object>" }, "type": "regular", "level": "medium" }
object
Advanced options for background blurring. See detailed description in the table below.
Below are advanced options supported by blur
:
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.
The category
background blur option is used by default and cannot be used together with selective
.
selective
object
Allows to specify exactly which object should remain on the image unblurred, e.g. "food"
, "sleeping bag"
, "product"
, etc. Specifying which object to keep is mandatory and should be short and precise.
The Selective background blur is an alternative to the category
option and cannot be used together.
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
false
by default. If true
, image is clipped to the foreground object bounds. Resulting image canvas is controlled by the block.