Background Removal API – remove.bg
发布时间:2026-09-17 | 浏览:1
Do more with your background removal API
Starting December 1, 2026, background removal moves to Leonardo.Ai, also part of Canva. Same simple integration, plus a full creative toolkit that picks up right where background removal leaves off.
Upscale automatically. Sharpen low-res product photos into marketplace-ready assets.
Generate new scenes. Place your cutout into any background, for lifestyle shots, seasonal refreshes, or A/B tests.
Turn stills into video. Animate product images with motion, transitions, and sound.
Chain it into one call. Combine all of the above and much more into a single Blueprint.
Remove Background automatically with 1 API call
Explore our API documentation and examples to integrate remove.bg into your application or workflow.
Easy to integrate
Our API is a simple HTTP interface with various options:
Our API is a simple HTTP interface with various options:
Get your API Key . Your first 50 API calls per month are on us (see Pricing ).
Use the following code samples to get started quickly
Review the reference docs to adjust any parameters
Get up and running faster with official and third-party libraries.
Commandline Tool
PHP/Laravel Library
Node.js: remove.bg
Node.js: removd
Python: remove.bg
You can request one of four formats via the format parameter:
Please note that PNG images above 10 megapixels are not supported . If you require transparency for images of that size, use either WebP or ZIP format (see below). For the fastest processing we recommend the ZIP format. If you don't need transparency (e.g. white background), we recommend JPG.
How to use the ZIP format
The ZIP format has the best runtime performance for transparent images.
In comparison to PNG, the resulting file is up to 80% smaller (faster to download) and up to 40% faster to generate. For performance optimization we recommend using the ZIP format whenever possible.
The ZIP file always contains the following files:
To compose the final image file:
Extract the files from the ZIP
Apply the alpha matte (alpha.png) to the color image (color.jpg).
Save the result in a format of your choice (e.g. PNG)
Sample code for linux (requires zip and imagemagick ): $ unzip no-bg.zip && \ convert color.jpg alpha.png \ -compose CopyOpacity \ -composite no-bg.png
A zip2png command is integrated in our command line interface . More code samples can be found here .
If you want to authenticate users with the click of a button instead of having them enter an API Key, get in touch to try our OAuth 2.0 login.
You can process up to 500 images per minute through the API, depending on the input image resolution in megapixels.
Exceedance of rate limits leads to a HTTP status 429 response (no credits charged). Clients can use the following response headers to gracefully handle rate limits:
Higher rate limits are only available to high-volume solution users; get in touch here .
Handling Rate Limits in your code using the HTTP Retry-After header:
Exponential backoff
Exponential backoff is an error handling strategy in which a client periodically retries a failed request. This technique reduces the number of failed requests and prevents server overload by gradually increasing the waiting time between retries.
The delay increases between requests and often includes jitter (randomized delay) to avoid collisions when using concurrent clients. Clients should use exponential backoff whenever they receive a 5XX HTTP status code, such as 503 - Service Unavailable .
As a general rule, this should be avoided in case of 429 - Too Many Requests , as they are usually caused by client-side issues.
Most recent API updates:
2025-04-07: Drop Shadow is now more consistent across images, regardless of their resolution.
2025-03-31: Added support for WebP as an accepted input and output image format.
2024-12-13: Added code samples and tips in the Exponential Backoff section.
2024-06-03: Introduced new parameters: shadow_type and shadow_opacity . Deprecated parameter: add_shadow . Extended type parameter with new values: "graphic", "transportation" and "animal".
2024-03-17: Added new value for size parameter: 50MP for up to 50 megapixels (e.g., 8000x6250 pixels) with formats ZIP or JPG, or up to 10 megapixels (e.g., 4000x2500 pixels) with PNG – costs 1 credit per image. The "auto" option keeps supporting a maximum of 25MP for backwards compatibility.
2024-01-10: Final reminder - Deprecation of TLS 1.0 and 1.1 . Upgrade to TLS 1.2 or higher for uninterrupted service before 2024-02-05.
2023-12-06: Second notice - Deprecation of TLS 1.0 and 1.1 . Upgrade to TLS 1.2 or higher for uninterrupted service before 2024-02-05.
2023-11-22: First notice - Deprecation of TLS 1.0 and 1.1 . Upgrade to TLS 1.2 or higher for uninterrupted service before 2024-02-05.
2021-12-07: Added foreground position and size to background removal responses. (JSON fields: foreground_top , foreground_left , foreground_width and foreground_height . Response headers: X-Foreground-Top , X-Foreground-Left , X-Foreground-Width and X-Foreground-Height .)
2021-04-13: Removed deprecated shadow_method=legacy option and shadow_method parameter as it no longer has any effect.
2021-03-01: Added examples for 400 error codes.
2021-01-21: Added shadow_method parameter to control shadow appearance. Deprecated legacy value for shadow_method .
2020-09-30: Added type_level parameter and POST /improve endpoint.
2020-05-06: Added semitransparency parameter.
2019-09-27: Introduce ZIP format and support for images up to 25 megapixels.
2019-09-25: Increased maximum file size to 12 MB and rate limit to 500 images per minute. Rate limit is now resolution-dependent.
2019-09-16: Added enterprise credit balance field to account endpoint.
2019-08-01: Added add_shadow option for car images.
2019-06-26: Added crop_margin , scale and position parameters.
2019-06-19: Added support for animals and other foregrounds (response header X-Type: animal and X-Type: other )
2019-06-11: Credit balances can now have fractional digits, this affects the X-Credits-Charged value
2019-06-03: Added parameters bg_image_url , bg_image_file (add a background image), crop (crop off empty regions) and roi (specify a region of interest).
2019-05-13: Added car support ( type=car parameter and X-Type: car response header)
2019-05-02: Renamed size "regular" to "small" . Clients should use the new value, but the old one will continue to work (deprecated)
2019-05-01: Added endpoint GET /account for credit balance lookups
2019-04-15: Added parameter format to set the result image format
2019-04-15: Added parameter bg_color to add a background color to the result image
Thanks for your feedback!
Want to help us improve? (optional)
Contribute this image & help us make remove.bg better
Teach the Artificial Intelligence
Get better results for similar images in the future
Your image will be used for future improvements of remove.bg.
Your image will NOT be used for future improvements of remove.bg.