The background removal parameter enables users to deliver images with different backgrounds. Once a background is removed, the image can then be transformed or combined with other images.
We support the following origin image formats by default:
For a complete list of supported image formats see which image formats can be served with imgix.
Images larger than 12 megabytes or 50 megapixels will be optimized for background removal by default.
To apply this parameter, add
bg-remove=true to your image URL. Although it may take up to a minute to process background removal, most requests complete in a few seconds. Once a background removal completes, the request will be cached, and subsequent requests will return in a much faster response time.
EX: Image with the Background Removed
- Original image: https://assets.imgix.net/woman-smiling-on-painted-background.jpeg
- Original image with background removed: https://assets.imgix.net/woman-smiling-on-painted-background.jpeg?bg-remove=true
EX: Filling in the transparent background with a new color
- Image with background filled: https://assets.imgix.net/woman-smiling-on-painted-background.jpeg?bg-remove=true&bg=DB2BBBD9&auto=compress,format&w=620
EX: Using a Watermark
- Using a watermark on the image: https://assets.imgix.net/base-background.jpg?dpr=2&auto=format&mark64=aHR0cHM6Ly9hc3NldHMuaW1naXgubmV0L3dvbWFuLXNtaWxpbmctb24tcGFpbnRlZC1iYWNrZ3JvdW5kLmpwZWc_YmctcmVtb3ZlPXRydWU&mark-scale=50&mark-align=bottom%2Ccenter&mark-pad=0&fm=png&ixlib=react-9.7.0&q=50&w=550&h=750
- Images with good lighting and high contrast between the foreground and background work best for background removal.
- Blurry or single-color backgrounds are preferred.
- Use an image with a sharp foreground since blurry foregrounds may be removed.
- For product images, the whole product should be visible and not cut off.
- The main subject or product should be in focus.
- Avoid hard shadows and reflections.
- Natural and eye-level angles are best.
Background removal can be a time-intensive process. To ensure your background-removed image is ready when a customer requests it, as soon as you know that you want to remove the background, issue a request to the imgix rendering API with
Background removal will fail gracefully by default. If background removal fails for any reason, the origin image will be served in its place. To override this behavior set
X-Imgix-Bg-Remove-Failure-Reason header will detail the reason for failure and will be present when
bg-remove-fallback is enabled or not.
Note: a purge request is required to replace or reprocess an image.
For many requests, the first time a background is removed will return within a few seconds. During higher loads, you may receive a temporary response while we're processing your request. This temporary response will have a 200 status code and return the origin image with a short cache duration.
This temporary response will also have the following header:
X-Imgix-Bg-Remove-Failure-Reason: Processing background removal request.
You can continue to retry the request until you receive the processed imaged without the failure header. All subsequent requests will return the image with the background removed.
For many requests, the first time a background is removed will return within a few seconds. During higher loads, you may receive a 423 status code while the removal is processing and your request will not return an image (if
You can continue to retry the request until you get a 200 status code and the processed image. All subsequent requests will return the image with the background removed.
Please reach out to your Account Manager or to Support if you have any questions or feedback.
See the API specification for more information about this parameter's value ranges and format.