Smart Plot
A one-stop AI image processing service for e-commerce sellers. It orchestrates six atomic abilities—element detection, intelligent matting, intelligent erasure, Image Translation Pro, intelligent cropping, and high-resolution upscaling—into an image processing workflow. Users can upload an image once, select the required abilities using the Ability parameter, and run multiple optimizations in a single, preset sequence. The service outputs product images that comply with the requirements of various listing platforms. Calls to this service are asynchronous.
Use cases
Ideal for bulk optimization of product images for cross-platform listings, this service adapts source product images into main, SKU, and detail images that meet the requirements of target listing platforms. It supports the following operations:
-
Detect low-quality images that contain text, watermarks, logos, or visual clutter, allowing you to filter which images to process.
-
Remove non-compliant elements such as watermarks, logos, visual clutter, and unwanted text from the original image.
-
Remove the background around the main subject of an image.
-
Translate text within an image to other languages.
-
Crop an image to a specified size.
-
Upscale an image by a specified factor.
API
This is an asynchronous API. Call the submit operation to get a TaskId,
then poll the query operation for the result.
Submit task
POST /rest/ai/image/visionflow
Query result
Use the unified asynchronous query API. Use the TaskId from the submit operation to poll for the task status. For details, see Asynchronous result query API.
POST /rest/ai/task/queryTaskResult
Quick start
import json, time
# 1. Submit the task
submit = make_signed_request("/rest/ai/image/visionflow", json.dumps({
"ImageUrl": "https://example.com/product.jpg",
"Ability": [1, 2, 3],
"NonobjectDetectElements": [1, 2, 3],
"IsFilter": True,
"BackGroundType": "WHITE_BACKGROUND",
"ObjectRemoveElements": [1, 3]
}))
task_id = submit["Data"]["TaskId"]
# 2. Poll for the result
while True:
time.sleep(5)
res = make_signed_request("/rest/ai/task/queryTaskResult", json.dumps({"TaskId": task_id}))
status = res["Data"]["Status"]
if status in ("COMPLETED", "FAILED"):
break
print(res["Data"]["Result"]["Result"]["FinalUrl"])
For complete request signing instructions, SDK examples in Java, Python, and Go, and online debugging, see the Alibaba Cloud OpenAPI Developer Portal: Smart Plot / Image Enhancement API (VisionFlow, OpenAPI Portal).
Feature overview
A user enters a product image URL and selects a combination of AI capabilities by using the Ability parameter. The system then executes the selected capabilities sequentially in a predefined order. The results of intelligent element detection affect the selection of subsequent capabilities. An additional IsFilter parameter allows the user to filter images based on the detection results to determine whether to proceed with the subsequent AI processing workflow.
The code, name, and description for each atomic ability are as follows:
|
Code |
Ability |
Description |
|
1 |
element detection |
Detects watermarks, logos, text, and visual clutter on both the main subject and the background. Can be used as a pre-filter to decide whether to apply subsequent abilities. |
|
2 |
intelligent matting |
Uses deep learning to precisely separate the main subject from the background, including fine details like hair and transparent objects. Outputs an image with a transparent or white background. |
|
3 |
intelligent erasure |
Removes text, specific names (brands/stores), transparent text blocks, and visual clutter. Supports specifying different elements for the main subject and the background. Accepts a Mask (RLE) for precise area selection. |
|
4 |
Image Translation Pro |
Multimodal AI-driven text translation for images. For details, see Image Translation Pro. |
|
5 |
intelligent cropping |
Center-crops the image based on |
|
6 |
high-resolution upscaling |
Enhances image quality by upscaling the image by the |
Before and after
|
Original image |
Abilities used |
Output image |
|
|
|
|
|
|
|
|
|
|
|
|
Submit API
Request parameters
The following table lists 17 fields, which are grouped by the selected ability. The ImageUrl and Ability fields are always required. For the other fields, the 'Required' column indicates if a field is mandatory when you enable the corresponding ability (by including its code in the Ability parameter): Yes means the field is required for that ability, No means it is optional, and One of two required means you must specify at least one of the two fields in the same group. If an ability is not enabled, you do not need to pass the fields in its group.
|
Parameter |
Type |
Required |
Description |
|
Basic parameters |
|||
|
|
String |
Yes |
Image requirements: Resolution > 256×256 pixels; longer side ≤ 1920 pixels; shorter side ≤ 1080 pixels; size ≤ 5 MB. Supported formats: png, jpeg, jpg, bmp, webp. |
|
|
number[] |
Yes |
An array of AI capabilities to call. Multiple selections are allowed. For the enumerated values, see the table above. Example: |
|
element detection (Ability=1) |
|||
|
|
number[] |
One of two required |
The elements to detect on the main object: 1=watermark, 2=logo, 3=text, and 4=color blocks with text. This parameter and |
|
|
number[] |
One of two required |
The elements to detect on the background. The valid values are the same as for |
|
|
Boolean |
Yes |
Select whether to process images with this element ( |
|
intelligent matting (Ability=2) |
|||
|
|
String |
Yes |
|
|
intelligent erasure (Ability=3) |
|||
|
|
number[] |
One of two required |
Specifies the elements to remove from the subject: 1=transparent text blocks, 2=specific names, 3=text, 4=visual clutter. This parameter and |
|
|
number[] |
One of two required |
The elements to remove from the background. The valid values are the same as for |
|
|
String |
No |
The RLE format precisely specifies the removal area. When this format is used, the |
|
Image Translation Pro (Ability=4) |
|||
|
|
String |
No |
The source language code. For details, see Supported languages. |
|
|
String |
No |
The target language code. |
|
|
Boolean |
No |
Specifies whether to translate the main body text. If set to |
|
|
Boolean |
No |
Specifies whether to translate brand names. The default value is |
|
|
String |
No |
The glossary ID. For more information, see Glossary. |
|
intelligent cropping (Ability=5) |
|||
|
|
number |
Yes |
The target width in pixels. Valid values: 100–5000. |
|
|
number |
Yes |
The target height in pixels. Valid values: 100–5000. |
|
high-resolution upscaling (Ability=6) |
|||
|
|
number |
No |
The upscaling factor. Valid values: 2 to 4. Default: 2. |
Request example
{
"ImageUrl": "https://example.com/product.jpg",
"Ability": [1, 4, 5, 6],
"ObjectDetectElements": null,
"NonobjectDetectElements": [1, 2, 3],
"IsFilter": true,
"BackGroundType": "WHITE_BACKGROUND",
"ObjectRemoveElements": null,
"NonobjectRemoveElements": [1, 2, 3, 4],
"Mask": null,
"SourceLanguage": "zh",
"TargetLanguage": "en",
"IncludingProductArea": null,
"TranslatingBrandInTheProduct": null,
"Glossary": "glossary_1",
"TargetWidth": 800,
"TargetHeight": 600,
"UpscaleFactor": 2
}
Response parameters
|
Parameter |
Type |
Description |
|
|
String |
The status code. A successful operation returns |
|
|
String |
The error description. |
|
|
Boolean |
Indicates whether the request was successful. |
|
|
String |
The request ID. Provide this ID when troubleshooting. |
|
|
String |
The asynchronous task ID. Use this ID with the query API. |
Query API
Request parameters
|
Parameter |
Type |
Required |
Description |
|
|
String |
Yes |
The |
Request example
{ "TaskId": "75942c08-1d09-942f-bfa9-76703872e668" }
Response parameters
|
Parameter |
Type |
Description |
|
|
-- |
Same as the submit API. |
|
|
String |
The asynchronous task ID. |
|
|
String |
Task status: |
|
|
String (JSON) |
|
|
|
String |
The URL of the original input image. |
|
|
String |
The URL of the processed image. This is a signed OSS URL with an expiration time. |
|
|
Boolean |
Indicates whether the image passed the element detection check. This parameter is only meaningful when element detection ( |
|
|
String |
Indicates whether the main subject contains text, watermarks, logos, or color blocks with text ( |
|
|
String |
Indicates whether text, a watermark, a logo, or visual clutter was found on the background. |
Response examples
Note: Data.Result may return an Object or a JSON string, depending on the gateway version. We recommend that you always perform a type check on Data.Result before parsing it.
Response with Data.Result as an object:
{
"Data": {
"Status": "COMPLETED",
"TaskId": "4a5b8f01-6fa1-95ef-bfd3-89ae8abbb67a",
"Result": {
"Result": {
"ObjLogo": "false",
"NoobjLogo": "true",
"ElementStatus": true,
"NoobjWatermark": "true",
"FinalUrl": "http://dashscope-7c2c.oss-cn-shanghai.aliyuncs.com/.../result.png?...",
"ObjCharacter": "false",
"ObjNpx": "false",
"SrcUrl": "http://dashscope-7c2c.oss-cn-shanghai.aliyuncs.com/.../input.png?...",
"ObjWatermark": "false",
"NoobjCharacter": "true",
"NoobjNpx": "false"
}
}
},
"RequestId": "66256E25-2A3E-1A1A-BFAC-0969CA6B0F58",
"Message": "Success",
"Code": "success",
"Success": true
}
Response with Data.Result as a JSON string (requires parsing):
{
"Data": {
"Status": "COMPLETED",
"TaskId": "effaf12d-565d-9ae2-8e58-722e977f4ab2",
"Result": "{\"Result\": {\"ObjNpx\": \"false\", \"SrcUrl\": \"...\", \"FinalUrl\": \"...\", ...}}"
},
"RequestId": "3FBCE320-0605-1AF6-8F63-5171A43C1711",
"Message": "Success",
"Code": "success",
"Success": true
}
Error codes
Smart Plot uses a unified naming system for error codes. This API commonly triggers the following error codes:
-
InvalidParameter-- TheImageUrlis invalid (due to its resolution, size, or format), or theAbilityparameter is specified but a corresponding required parameter is missing. -
DownstreamUnavailable-- The image URL is inaccessible or the downstream model is temporarily unavailable. -
InputContentBlocked-- The input image triggered the content security review. -
FreeQuotaExhausted-- The trial quota is exhausted and no resource plan has been purchased.
For a complete list of error codes, see Error codes.
Supported languages
This parameter is valid only for Ability=4 (Image Translation Pro). Language codes are two-letter codes that follow ISO 639-1. Regional variants follow the RFC 5646 format, such as zh-tw for Traditional Chinese. Bridged translation is supported. For example, you can perform a zh to ar translation by bridging through en (zh→en→ar).
|
Source language |
Supported target languages |
|
Simplified Chinese ( |
en (English), ja (Japanese), ko (Korean) |
|
English ( |
ar, az, bn, cs, de, el, es, fi, fr, he, hi, hu, id, it, ja, ko, ms, my, ne, nl, pl, pt, ro, ru, si, sv, th, tl, tr, uk, ur, vi, zh (32 languages) |
|
Spanish ( |
bg, cs, da, de, el, en, et, fi, fr, hr, hu, it, lt, lv, nl, no, pl, pt, ro, ru, sk, sv (22 languages) |
|
Turkish ( |
ar, cs, de, el, en, hu, ro (7 languages) |
|
ar, az, bn, cs, de, el, fi, fr, he, hi, hu, id, it, ja, ko, ms, my, ne, nl, pl, pt, ro, ru, si, sv, th, tl, uk, ur, vi (30 languages) |
en (English) |
|
Traditional Chinese ( |
Via bridged translation: |
Limitations
-
Call mode: Asynchronous. The query API has no rate limit, but we recommend a polling interval of 5 seconds or more. For the rate limit of the submit API, see Rate limits.
-
Input image: Resolution must be greater than 256×256 pixels, with the longer side ≤ 1920 pixels and the shorter side ≤ 1080 pixels. The file size must be ≤ 5 MB. Supported formats: png, jpeg, jpg, bmp, webp.
intelligent cropping output size: 100–5000 pixels for both width and height.
-
high-resolution upscaling factor: 2 to 4.
-
Billing: You are charged based on the actual number of calls made to each atomic ability. For details, see Asset optimization billing.
FAQ
Next steps
-
Asset optimization: See an overview of other AI asset optimization APIs.
-
Error codes: See the complete error code reference.





