Free plan

Remove Plain Background

Make a plain-colour background transparent
POST
/v1/images/remove-background

About this tool

This tool turns the background of a picture see-through when it is one flat colour, such as a product photo on white or a green screen. It picks the background colour from the edges of the picture, or you can name the colour yourself. It does not find people or objects by itself, so it will not work on a busy background. You can set how close a colour must be to be removed and how soft the edge is.
For example, you remove the white background from a photo of a mug so you can place it on a coloured page in your online shop.

How to use it

  1. Choose this tool.
  2. Add your pictures with Upload or drag and drop.
  3. Leave the background colour on automatic, or choose the colour to remove.
  4. Adjust the tolerance and the edge softness if some background is left over.
  5. Press Generate, then download the result.

What you get back

You get new pictures with a see-through background, saved as PNG by default. Download them one by one.
GOOD TO KNOW
Pictures up to 36 megapixels. `removedRatio` tells how much of the picture became transparent: a value near 0 or 1 usually means the tolerance or background colour needs adjusting.
TEST IT LIVE

Try Remove Plain Background in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/remove-background
Tool ID
images.remove-background
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Image
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/images/remove-background" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'tolerance=12' \
  -F 'mode=edges' \
  -F 'feather=1'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.removeBackground({
    "images": 'photo.jpg',
    "tolerance": 12,
    "mode": "edges",
    "feather": 1
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->removeBackground([
    'images' => 'photo.jpg',
    'tolerance' => 12,
    'mode' => 'edges',
    'feather' => 1,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Makes the background of each picture transparent when it is (nearly) one colour: product photos on white, logos, scans, green-screen shots. Local and deterministic, no model. `mode=edges` removes only background connected to the picture's border; `mode=all` removes every matching pixel (chroma key). The result is a transparent PNG by default (any format that holds transparency via `output_format`). Pictures with a busy or graded background cannot be cut out by colour: use the AI image-edit endpoint for those.

Remove Plain Background accepts JPEG, PNG, WEBP, GIF, AVIF, TIFF, SVG, SVGZ, BMP, ICO, APNG, PNM and 9 more. You can send several files in one request.

Remove Plain Background is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/remove-background with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.