Image Cropping API Reference
Last updated
Last updated
GET/POST
/ai/image/cropping
Image Cropping allows you to resize any image to your desired dimensions. It supports automatic recognition of the main area of the image and crops images with precision, ideal for a wide range of design scenarios.
Parameter | Type | Required | Description |
---|---|---|---|
Parameter | Type | Description |
---|---|---|
Error Code | Error Message | Description |
---|---|---|
imageUrl
String
No
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).
Sample: http://example.jpg/
imageBase64
String
No
Base64 of image
It cannot be empty together with image URL. If both imageUrl and iImageBase64 exist, Base64 is preferred.
Input image size should be between 512×512 pixels(minimum) and 3000×3000 pixels(maximum).
targetWidth
Int
Yes
Target width of image.
Unit:Pixel. Range:100-5000
Sample: 800
targetHeight
Int
Yes
Target height of image.
Unit:Pixel. Range:100-5000
Sample: 800
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.
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 has sensitive data, please try other input. If an error persists,please contact us via navigation bar or email us (aidge_support@service.alibaba.com).
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).