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
imageUrl
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).
imageBase64
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).
backGroundType
String
Yes
The result of image background format.
Range:
WHITE_BACKGROUND:ouput white background
TRANSPARENT:output transparent background
Sample: WHITE_BACKGROUND
targetWidth
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
Sample: 800
targetHeight
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: 800
Sample Request
Response Parameters
resCode
Number
The returned result code, where 200 indicates success. For detailed error codes, please refer to the error code list.
data
Object
The returned result data.
requestId
String
A unique request ID used for troubleshooting.
success
Boolean
The status of the returned request, indicating whether the request was successful.
resMessage
String
The returned request information.
Sample Response
Errors
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