# Method: accounts.generatedImages.removeProductImageBackground

- [HTTP request](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#body.request_body)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#body.response_body)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#body.RemoveProductImageBackgroundResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#body.aspect)
- [RemoveImageBackgroundConfig](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#RemoveImageBackgroundConfig)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#RemoveImageBackgroundConfig.SCHEMA_REPRESENTATION)
- [RgbColor](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#RgbColor)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#RgbColor.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#try-it)

generatedImages.removeProductImageBackground generates a new image where the background of the original image is removed.

### HTTP request

`POST https://merchantapi.googleapis.com/productstudio/v1alpha/{name=accounts/*}/generatedImages:removeProductImageBackground`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The account for which to generate an image. This acts as a container for the request and does not affect the generation itself. Format: accounts/{account} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "outputConfig": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/OutputImageConfig`) }, "inputImage": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/InputImage`) }, "config": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#RemoveImageBackgroundConfig`) } } ``` |

| Fields ||
|---|---|
| `outputConfig` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/OutputImageConfig`)`` Optional. Configuration for how the output image should be returned. |
| `inputImage` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/InputImage`)`` Required. The input image. |
| `config` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#RemoveImageBackgroundConfig`)`` Optional. Configuration parameters for the removal of the background. |

### Response body

Response message for the generatedImages.removeProductImageBackground method.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "generatedImage": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/GeneratedImage`) } } ``` |

| Fields ||
|---|---|
| `generatedImage` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/GeneratedImage`)`` The generated output image. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/content`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).

## RemoveImageBackgroundConfig

Client provided input configuration for removing the background.

| JSON representation |
|---|
| ``` { "backgroundColor": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#RgbColor`) } } ``` |

| Fields ||
|---|---|
| `backgroundColor` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/removeProductImageBackground#RgbColor`)`` Optional. If set, the result of background removal will be an RGB image with this given color as the background, instead of an RGBA 4-channel transparent image. |

## RgbColor

Represents a color in RGB format.

| JSON representation |
|---|
| ``` { "red": integer, "green": integer, "blue": integer } ``` |

| Fields ||
|---|---|
| `red` | `integer` Optional. Values in \[0, 255\]. |
| `green` | `integer` Optional. Values in \[0, 255\]. |
| `blue` | `integer` Optional. Values in \[0, 255\]. |