> For the complete documentation index, see [llms.txt](https://docs.qolaba.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qolaba.ai/api-platform/api-platform/background-removal.md).

# Background Removal

The Background Removal model offers a versatile solution for removing the background from an image. By default, it replaces the background with a transparent backdrop.

You can also customize the background by specifying the RGB values and activating the `bg_color` parameter. Additionally, you can choose to blur the background or replace it with a different image.

This model provides a flexible tool for enhancing your images by transforming and personalizing the setting to suit your vision. For more details on this model, please refer to the [Broken mention](broken://pages/N9PrN6Bz3ihq0O05mZpK) section.

## Remove Background API

<mark style="color:green;">`POST`</mark> `/getImagetoImage`

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name      | Type   | Description                                                                                                                                                                                                                                                                                                       |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| app\_id   | string | -> Each model is uniquely characterized by its own `app_id`.                                                                                                                                                                                                                                                      |
| image     | number | <p>-> The <code>image</code> parameter specifies the URL of an existing image that will be used as a reference for the generation process. </p><p>-> If the original image dimensions exceed 1536x1536 pixels, the image will be adjusted to fit within this size while preserving the original aspect ratio.</p> |
| bg\_img   | string | -> The `bg_image` parameter allows you to specify a URL for an image that will be used as the background for the generated image.                                                                                                                                                                                 |
| bg\_color | bool   | -> To use a custom background color, set the `bg_color` parameter to `true`. This will allow you to specify the desired RGB color values for the background.                                                                                                                                                      |
| r\_color  | int    | -> The `r_color` parameter controls the strength of the red hue in the background color, with a range from 0 to 255. Higher values result in a more vibrant red, while lower values make the red more subdued.                                                                                                    |
| g\_color  | int    | -> The `g_color` parameter controls the strength of the green hue in the background color, with a range from 0 to 255. Higher values result in a more vibrant green, while lower values make the green more subdued.                                                                                              |
| b\_color  | int    | -> The `b_color` parameter controls the strength of the blue hue in the background color, with a range from 0 to 255. Higher values result in a more vibrant blue, while lower values make the blue more subdued.                                                                                                 |
| blur      | bool   | -> Enable the `blur` parameter to apply a blurring effect to the background of the generated image, creating a captivating and enchanting visual effect.                                                                                                                                                          |
| celery    | bool   | -> The `celery` parameter is used for queuing tasks that require extended processing time. When you enqueue a task, you receive a unique `task_id`. This `task_id` allows you to check the task's status later using the task status API, which is useful for managing and tracking long-running tasks.           |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "time_required": "",
  "error": "",
  "error_data": "",
  "input": "",
  "output": "",
  "app_id": "",
  "task_id": "",
  "status": ""
}
```

{% endtab %}

{% tab title="500" %}

```json
{
  "time_required": "",
  "error": "",
  "error_data": "",
  "input": "",
  "output": "",
  "app_id": "",
  "task_id": "",
  "status": ""
}
```

{% endtab %}
{% endtabs %}

## Run the API

To test this API, please use the following link:

{% embed url="<https://app.theneo.io/api-runner/qolaba/ml-apis/api-reference/background-removal>" %}
