Car Background Removal

Remove Background API for Car images: Enhance your automotive sales with our industry-specific tool

 

 About

Our car image editing solution is designed to enhance automotive imagery, featuring high-accuracy segmentation, background removal, shadow effects, license plate blurring, and custom background replacement.

Background
Removal

The main idea of the algorithm is to remove BG instantly and keep only the foreground. Enhancing your car dealership's visuals with consistent, branded backgrounds boosts online appeal and strengthens brand identity, attracting more buyers and enhancing market presence.

Shadow
effect

Additionally, it adds realistic shadows to the segmented car images, enhancing their visual appeal. This optional enhancement significantly improves the overall presentation of car images, making them more attractive for online listings and promotional materials.

Blurring
licence plates

An advanced blurring feature for license plates of any country or shape ensures global privacy and compliance, ideal for car dealerships, automotive photographers, and online marketplaces aiming to improve digital images while adhering to privacy laws.

Demo

Try this solution out right now! Select one of the pictures below or upload your own image.

Bubble.io plugin integration

Step-by-step guide

Step 1: Install the plugin via the “Plugins” section in the development portal of your application.

Step 2: To add the “Remove background” action to your Bubble workflow, simply navigate to the “Plugins” section in the workflow editor and select the desired item from the list.

Step 3: Set the image source. You can choose to set a static image if you prefer, but it is more common to set a dynamic image source.

Example: The typical case is to use PictureUploader’s or FileUploader’s value as the source for a “Dynamic image”.

Step 4 (optional): If it better suits your needs, adjust the optional parameters as follows:

  • Enable "Mask mode" to receive the car mask.

  • Switch the result representation from base64 to a URL.

  • Disable “Draw shadow” if you do not need it.

  • Enable “Hide car license plates” feature (may slightly degrade performance).


For more details, see below ↓

Step 5: Retrieve and use the returned values.

Example: Use the “Result image” to update a HTML element through a Custom state.


For more details, see below ↓

About “base64” and “URL“

Base64 is a common method for encoding a binary file as a string. It can be used for base64 file encoding in various applications, including web applications. By default, the Background Removal API returns a PNG image encoded as a base64 string. However, in some cases, it may be more appropriate to obtain a direct URL to an image file. API4AI also offers this functionality and hosts the resulting image for one day:

  • To receive the result image as a base64 string, select the "Return base64" option.

  • To obtain the result image as a regular URL to a file (hosted by API4AI for one day), deselect the "Return base64" option.

Hint: If you wish to set a base64 encoded image as the src attribute value of an <img> HTML element, remember to add data:image/png;base64, (don’t miss the comma!) before the actual base64 content. This informs the web browser that the src contains a PNG image encoded as base64 rather than a URL. For more information on displaying base64 images in HTML, visit: https://www.w3docs.com/snippets/html/how-to-display-base64-images-in-html.html

base64 encoded image

URL to image

About “Mask mode”

By default, the Background Removal API returns a PNG image with the background removed. However, in some use cases, it is preferred to receive a mask of the car. Technically, the mask is also a PNG image, but instead of containing the original image content with the background removed, it consists of pixels ranging from black to white. White pixels correspond to the car area, while black pixels correspond to the background area. Grayscale pixels are transitional.

Car image with the background removed

Mask of the car

About “Shadow”

To enhance visual appeal, the Car Background Removal API may add realistic shadows to the segmented car images. This optional enhancement significantly improves the overall presentation of car images, making them more attractive for online listings and promotional materials. You can enable or disable this feature using the "Draw shadow" option.

Car image with the background removed

Car image with the background removed and a shadow drawn underneath

About “Hiding car license plates”

The "hide car license plate" feature may be needed for privacy and security or other reasons. This feature may be particularly important when sharing car images online or in public settings where the license plate may be visible to others.

The Car Background Removal API offer an advanced blurring feature for license plates of any country or shape ensures global privacy and compliance, ideal for car dealerships, automotive photographers, and online marketplaces aiming to improve digital images while adhering to privacy laws.

Note: Enabling this feature may slightly degrade performance.

Car image with the background removed

Car image with the background removed and an automatically hidden license plate

Returned values

The “Remove background” action returns a set of values which can be used to obtain processing results or to handle errors:

  • result (image) – The resulting PNG image, represented as base64 string or a URL to a file hosted by api4ai (valid for 1 day).

  • success (yes/no) – A boolean flag indicating whether the processing finished successfully.

  • message (text) – A message explaining the processing status.

Looking for direct HTTP API integration?

Just copy&paste this snippet code into your command line terminal to try the API at your computer
$
curl -X "POST" \
  "https://demo.api4ai.cloud/img-bg-removal/v1/cars/results" \
  -F "url=https://storage.googleapis.com/api4ai-static/samples/img-bg-removal-cars-1.jpg"
Or try web sample right in JSFiddle code playground
Explore more code examples for various programming languages: