Last updated: Dec-11-2024
Cloudinary is a cloud-based service that provides an end-to-end asset management solution that covers uploads, storage, transformations, optimizations and delivery.
Cloudinary offers a very rich set of image transformation capabilities and allows you to upload images to the cloud, crop them on the fly and have them further transformed to match the graphic design of your websites and mobile applications.
Pixelz is a leading vendor of image editing solution components, including powerful background removal of photos, done by a team of human experts. Cloudinary provides a Remove-The-Background add-on for using Pixelz's image editing capabilities, fully integrated into Cloudinary's image management and transformation pipeline.
With the Pixelz - Remove the Background add-on, you can extend Cloudinary's image transformation capabilities with automatic background removal from your photos, resulting in a transparent-background image focusing on the main object of your photo.
Getting started
Before you can use the Pixelz - Remove the Background add-on:
You must have a Cloudinary account. If you don't already have one, you can sign up for a free account.
Register for the add-on: make sure you're logged in to your account and then go to the Add-ons page. For more information about add-on registrations, see Registering for add-ons.
Keep in mind that many of the examples on this page use our SDKs. For SDK installation and configuration details, see the relevant SDK guide.
If you're new to Cloudinary, you may want to take a look at the Developer Kickstart for a hands-on, step-by-step introduction to Programmable Media features.
Remove image background
You can try the Pixelz - Remove the Background add-on for free and later on register for an add-on plan that best matches your usage requirements.
In order to remove the background from your images, you will first need to upload images to Cloudinary. Requesting background removal can be done either while uploading files to Cloudinary (from your server-side code or directly from the browser), or by updating an existing image, either programmatically or interactively.
The following code sample shows how to upload a photo to Cloudinary, while telling Cloudinary to remove its background. In order to remove the background of the uploaded image, the background_removal
parameter should be set to pixelz
.
Learn more: Upload presets
Background removal is performed asynchronously in the background after the upload call is completed.
The response of the uploaded request mentions that the editing process is in the pending
status.
As a result of the upload example above, the original image is automatically sent, behind the scenes, to Remove-The-Background for editing. When background removal is completed, the original image is automatically replaced with the edited one and is available for delivery via a fast CDN, without any code changes required. The original image is made available as a backed-up revision of the image and you can always revert to it, if needed.
For example, the following dynamic transformation and delivery URL shows the original image of an uploaded wooden chair photo:
Below you can see the result of Remove-The-Background editing:
Update existing images
The examples above show how to automatically schedule background removal of images during their upload process. As an alternative, you can use Cloudinary's Admin API to request background removal to already uploaded images, based on their public IDs.
For example, the following code sample uses Cloudinary's update
API to apply background removal to the uploaded image that has the wood_chair
public ID.
You can also use Cloudinary's media library to interactively tell Cloudinary to remove the background of an existing image via your web browser:
Status notification
The Pixelz - Remove the Background add-on edits images asynchronously. The image editing is done by a trained team of human experts and may take up to 24 hours to complete. As a result, you may want to get notified when the editing process is completed.
When calling the upload API with background removal request, you can request a notification by adding the notification_url
parameter to a public HTTP or HTTPS URL of your online web application. Cloudinary sends a POST request to the specified endpoint when image editing is completed.
The following JSON snippet is an example of a POST request sent to the notification URL when image editing is completed:
The JSON content is signed using your product environment API secret. For more details regarding Cloudinary's notifications and webhooks, see this blog post.
Contest
button, and fill in the reason for your redo request.Further image transformations
Images edited for removing their backgrounds can be mixed with any of Cloudinary's rich set of image transformation capabilities.
For example, the following dynamic transformation and delivery URL generates a 200x200 padded version of the edited image. Image color saturation is increased by 50%. A shadow is added and so is a solid one pixel black border. This technique can be used to make sure that all product images on your e-commerce website share a consistent look & feel.
Another example, this time fitting the edited image to a 200x200 frame. The image is flipped horizontally and a watermark of Cloudinary's icon is added while increasing its brightness and making it semi-transparent.
For a full list of additional Cloudinary's image transformation options, see Image transformations.