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

Screenshot of a webpage showing installed plugins. Blue arrows with text labels point out the 'Install plugin' button, a 'Try plugin demo' link, and an 'Ask a question' link.

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

Screenshot of a software interface showing the 'Plugins' section open, with an option to 'Remove background' highlighted and two blue arrows with instructions to open 'Plugins' and choose 'Remove background'.

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.

Screenshot of a software interface for removing backgrounds from images, with options to upload static or dynamic images, search for external sources, and customize background removal settings.

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.

Screenshot of a software interface showing settings for removing a background, with an example text box demonstrating setting a dynamic image value.

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

Screenshot of a software interface showing mask mode, base64 output, shadow drawing, and license plate hiding options with instructional text in blue.

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 ↓

Screenshot of a computer interface showing a 'Set state' dialog box with options to update an HTML element's custom state to a 'Result image' based on a 'Result' value from a previous step, with instructional text in blue on the right side.

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

Screenshot of a web interface demonstrating car background removal, featuring a red car with the background removed. The original image of the red car is visible on the left, and the processed image on the right. The interface has options for different return types, shadow drawing, and license plate hiding, with success messages displayed.

base64 encoded image

Side view of a red hatchback car parked on the street with a modern building in the background.

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.

Red modern hatchback car with black wheels and tinted windows, parked on a plain background.

Car image with the background removed

White silhouette of a compact car against a black background.

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.

Red hatchback car with black rims and tinted windows, side view

Car image with the background removed

Side view of a red modern luxury hatchback car with black alloy wheels.

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.

A white Mercedes-Benz sedan driving on a road, viewed from the front three-quarter angle, with a person driving.

Car image with the background removed

A white Mercedes-Benz sedan with black-rimmed wheels, front grille, tinted windows, and a driver inside, parked on a plain background.

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: