- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- RemoveImageBackgroundConfig
- RgbColor
- 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 syntax.
Path parameters
Parameters | |
---|---|
name |
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 ( |
Fields | |
---|---|
outputConfig |
Optional. Configuration for how the output image should be returned. |
inputImage |
Required. The input image. |
config |
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 ( |
Fields | |
---|---|
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.
RemoveImageBackgroundConfig
Client provided input configuration for removing the background.
JSON representation |
---|
{
"backgroundColor": {
object ( |
Fields | |
---|---|
backgroundColor |
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 |
Optional. Values in [0, 255]. |
green |
Optional. Values in [0, 255]. |
blue |
Optional. Values in [0, 255]. |