Image Background Removal API Reference
Image Background Removal
GET/POST
/ai/image/cut/out
The Image Background Removal automatically identifies the main object in an image, separates it from the background, and returns the image of main object with white or transparent backgrounds. It provides a variety of background options and custom size selections to optimize product display.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
| String | No | The image URL. Either imageUrl or imageBase64 should be input as request parameter. ImageBase64 is preferred when both imageUrl and imageBase64 exist. Input image size should be between 100×100 pixels(minimum) and 3000×3000 pixels(maximum). |
| String | No | The Base64 encoding of the image. Either imageUrl or imageBase64 should be input as request parameter. ImageBase64 is preferred when both imageUrl and imageBase64 exist. Input image size should be between 100×100 pixels(minimum) and 3000×3000 pixels(maximum). |
| String | Yes | The result of image background format. If not be set, it will output transparent background. Range: WHITE_BACKGROUND:ouput white background TRANSPARENT:output transparent background
|
| Int | No | Set the width of the output image. After setting, it returns an image with automatically cropped edge blank areas and scaled to the target size. If not, it will output original width without changing the subject's position. Pixel Range:100-3000
|
| Int | No | Set the height of the output image. After setting, it returns an image with automatically cropped edge blank areas and scaled to the target size. If not, it will output original height without changing the subject's position. Pixel Range:100-3000
|
Sample Request
Response Parameters
Parameter | Type | Description |
---|---|---|
| Number | The returned result code, where 200 indicates success. For detailed error codes, please refer to the error code list. |
| Object | The returned result data. |
| String | A unique request ID used for troubleshooting. |
| Boolean | The status of the returned request, indicating whether the request was successful. |
| String | The returned request information. |
Sample Response
Errors
Error Code | Error Message | Description |
---|---|---|
500 | system error | System error. |
501 | rate limit exceed | The current interface has reached the current limit. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) to increase the current limit value. |
700 | invalid input | The format of the input parameters does not meet the requirements, and resMessage will return detailed fields that do not meet the requirements. |
801 | model failed | Internal call exception, please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting. |
1000 | content has sensitive data, please try other input | Content has sensitive data and cannot be handled now. Please try other input. |
1001 | content control failed, please retry | Content risk failed, please try other input. If an error persists,please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting. |
1002 | content risk filter failed, please contact us | Content risk filter failed, please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting. |
Last updated