---
title: Remove Image Background with Advanced Controls API
slug: new-service-3
url: https://apyhub.com/callable-labs/service/new-service-3
provider: Callable Labs
tags: [background-removal, image-segmentation, image-cutout, png-transparency]
auth: api_key
version: v1
service_type: sync
endpoints: 1
atoms: 800
mcp: true
---

# Remove Image Background with Advanced Controls API

What it does Remove Image Background with Advanced Controls API removes the background from an image and returns the cut-out subject in the format you request. Send an image by public URL or base64, and choose whether you want JSON metadata, PNG, WebP, or JPEG output. Use crop to trim the result to…

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/callable-labs/new-service-3/v1/background/remove` | What it does Removes the background from an input image and returns result metadata plus the proces… | 800 |

## Endpoint reference

### Remove the background

`POST https://api.eu.apyhub.com/callable-labs/new-service-3/v1/background/remove` · 800 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `crop` | body | boolean | no | Crop the result to the subject's bounding box. Default: `false`. Default: `false`. |
| `image` | body | any | yes | Image source. Provide one of `image.url` or `image.base64`. |
| `format` | body | string | no | Output encoding. Allowed values: `json`, `png`, `webp`, `jpeg`. Default: `json`. `json` returns metadata plus a PNG data URI. `png` and `webp` return the image bytes. `jpeg` needs an opaque `backgrou… |
| `padding` | body | integer | no | Pixels kept around the subject when `crop` is true. Default: `0`. Minimum: `0`. Maximum: `1000`. Default: `0`. |
| `quality` | body | string | no | Processing quality. Allowed values: `best`, `fast`. Default: `best`. `best` prioritizes detail. `fast` is suitable for previews. One of: best, fast. Default: `best`. |
| `max_size` | body | any | no | Longest side of the output in pixels. Default: null (original size). Minimum: `64`. Maximum: `4096`. Default: `null`. |
| `background` | body | string | no | Background color to place the subject on. Default: `transparent`. Allowed values: `transparent` or a hex color in `#RRGGBB` format. Default: `transparent`. Example: `transparent`. |

#### Quickstart

Remove the background from an image URL and return the result as JSON metadata.

```bash
curl -X POST "https://api.eu.apyhub.com/callable-labs/new-service-3/v1/background/remove" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "image": {
      "url": "https://assets.apyhub.com/samples/cat.jpg"
    }
  }'
```

#### What you'll get back

Returns a JSON object with `format`, `media_type`, `width`, `height`, `bytes`, `data_uri`, `bbox`, `foreground_ratio`, and `quality`.

- `format` (`string`): encoding of `data_uri`
- `media_type` (`string`): the output media type
- `width` / `height` (`integer`): output dimensions in pixels
- `bytes` (`integer`): output size in bytes
- `data_uri` (`string`): a `data:<media_type>;base64,…` payload
- `bbox` (`object` or `null`): subject bounding box in the original image
- `foreground_ratio` (`number`): share of the original image covered by the subject
- `quality` (`string`): `best` or `fast`

```json
{
  "format": "json",
  "media_type": "image/png",
  "width": 1200,
  "height": 900,
  "bytes": 123456,
  "data_uri": "data:image/png;base64,...",
  "bbox": { "x": 120, "y": 80, "width": 900, "height": 700 },
  "foreground_ratio": 0.42,
  "quality": "best"
}
```

## About

## What it does
Remove Image Background with Advanced Controls API removes the background from an image and returns the cut-out subject in the format you request. Send an image by public URL or base64, and choose whether you want JSON metadata, PNG, WebP, or JPEG output.

Use `crop` to trim the result to the subject's bounding box, and `padding` to keep extra pixels around it when cropping. You can also set `quality` to `best` or `fast`, limit the output with `max_size`, and place the subject on a transparent background or a solid `#RRGGBB` color. JPEG output requires an opaque background, while `json` returns metadata plus a PNG data URI.

The response includes the output `format`, `media_type`, `width`, `height`, `bytes`, `data_uri`, `quality`, and `foreground_ratio`. It also returns the subject `bbox` in the original image when one is found, or `null` when nothing is detected.

Use it for product photos, profile images, marketplace listings, and any workflow that needs a clean foreground subject without manual editing.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/callable-labs/service/new-service-3
