
Remove the background from images
π€/image/bgremove removes the background from images.
This Robot detects and removes the background of an image.
Using top-tier AI technologies, the foreground elements in an image are detected and separated from the background region, which is then replaced by transparency. The final result will be an image with only the foreground elements.
If you want to change the image's size, format or background color, we recommend using this Robot with π€/image/resize.
Pricing
This Robot leverages top-tier AI technologies behind the scenes. For this, we partner with multiple providers and can continually pick the best-performing and most cost-effective option.
The price paid reflects the actual usage fees of these AI services, plus a margin that allows us to maintain and evolve these transformations at scale. This ensures pricing that will only go down as we find cost optimizations, and removes the complexity of managing different AI providers yourself. We anticipate the cost will generally be between 0.003 and 0.005 USD per image, though this is subject to change based on provider costs. We will always ensure you get the best AI capabilities in your Transloadit workflows.
The cost in USD is converted to usage in bytes based on your current plan's price per included GB, which is your plan's monthly price divided by its included GB per month. If you are on a free plan or a plan with no included GB, a price per included GB of 2 USD per GB is used.
Usage example
Remove the background from the uploaded image:
{
"steps": {
"remove_background": {
"robot": "/image/bgremove",
"use": ":original"
}
}
}
Parameters
-
use
String / Array of Strings / Object requiredSpecifies which Step(s) to use as input.
-
You can pick any names for Steps except
":original"
(reserved for user uploads handled by Transloadit) -
You can provide several Steps as input with arrays:
"use": [ ":original", "encoded", "resized" ]
π‘ Thatβs likely all you need to know about
use
, but you can view Advanced use cases. -
-
output_meta
Object / Boolean β default:{}
Allows you to specify a set of metadata that is more expensive on CPU power to calculate, and thus is disabled by default to keep your Assemblies processing fast.
For images, you can add
"has_transparency": true
in this object to extract if the image contains transparent parts and"dominant_colors": true
to extract an array of hexadecimal color codes from the image.For videos, you can add the
"colorspace: true"
parameter to extract the colorspace of the output video.For audio, you can add
"mean_volume": true
to get a single value representing the mean average volume of the audio file.You can also set this to
false
to skip metadata extraction and speed up transcoding. -
format
String β default:"png"
The output format for the modified image.
Currently, only PNG is supported. To change the image format, you can use π€/image/resize.
Demos
Related blog posts
- Automatic background removal from images March 10, 2025