Image Elements Removal API Reference
Image Elements Removal
GET/POST
/ai/image/removal
Image Elements Removal is tailored for e-commerce images, capable of automatically identifying and removing Semi-Transparent Elements, Specific Name, Character, Color-Blocks with Characters from e-commerce images. It allows for the specification of objects to be removed within the images, achieving efficient and precise processing of large volumes of images, thus simplifying the image editing process.
Request Parameters
image_url
String
No
URL of the original image; cannot be empty at the same time as Base64. It is recommended to upload the image URL, and it will be prioritized if provided. The image should be in JPG, JPEG, PNG, or BMP format, with a resolution between 512x512 and 3000x3000 pixels, and a file size of no more than 10MB.
Example:
http://example.jpg/
image_Base64
String
No
Base64 of the original image (The image should be in JPG, JPEG, PNG, or BMP format, with a resolution between 512x512 and 3000x3000 pixels, and a file size of no more than 10MB.). Example: iVBORw0KGgoAAAANSUhEUgAAAAUAAA...
object_remove_elements
Number[]
Yes
Elements to be removed from the image's main subject (1=Semi-Transparent Elements; 2=Specific Name; 3=Character; 4=Color-Blocks with Characters). The main subject of the image refers to the core product area within the image. For more examples, refer to the product introduction document:Image Elements Removal.
Example: [1, 2, 4]
non_object_remove_elements
Number[]
No
Elements to be removed from non-main subjects of the image (1=Semi-Transparent Elements; 2=Specific Name; 3=Character; 4=Color-Blocks with Characters). Cannot be empty at the same time as remove_non_product_area_elements. For more examples, refer to the product introduction document: Image Elements Removal.
Example: [1, 2, 4]
mask
String
No
The specific area for removal. It is optional and requires use with an editor. The input format is RLE. If provided, it will take precedence over the remove_non_product_area_elements and remove_product_area_elements parameters.
Example: 474556 160 475356 160 476156 160 476956 160 477756 160 478556 160 479356 160 480156 160 480956 160 481756 160 482556 160 483356 160 484156 160 484956 160 485756 160 486556 160 487356 160 488156 160 488956 160 489756 160 490556 160 491356 160 492156 160
Sample Request
Response Parameters
resCode
Number
Response code; 200 represents a successful call, other response codes can refer to the error code information.
data
Object
The structure of the returned result.
requestId
String
Request ID; used to identify a unique request call.
success
Boolean
Whether the operation was successful; true for success, false for failure.
resMessage
String
Error message, such as "content has sensitive data, please try other input".
Sample Response
Errors
501
rate limit exceed
The current interface has reached the rate limit. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) to increase the limit.
700
invalid input
The input parameter format does not meet the requirements; resMessage will return details.
701
image url error
Failed to Download Image from URL, please retry.
702
image base64 error
Image Base64 Download or Recognition Failed.
703
image size exceeds the limit
The image size exceeds the limit, please provide an image within the limit.
704
invalid image form
The image format is not supported.
705
image file size exceeds the limit
The image file size after parsing should be within 10 MB.
801
model failed
Internal call exception, please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting.
900
tpp url error
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
The request contains sensitive information, not supported at the moment, please try other inputs.
1001
content control failed, please retry
Content control service failed, please retry, and please contact us via navigation bar or email us (aidge_support@service.alibaba.com) if the error persists.
1002
content risk filter failed, please contact us
Content risk filter service failed, please contact us via navigation bar or email us (aidge_support@service.alibaba.com).
Last updated