Smart Plot

Updated at:

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"])

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 TargetWidth / TargetHeight and retains the main subject.

6

high-resolution upscaling

Enhances image quality by upscaling the image by the UpscaleFactor (2–4, default: 2).

Before and after

Original image

Abilities used

Output image

image.png

  • element detection

  • Image Translation Pro

  • intelligent cropping

image.png

image.png

  • intelligent matting

  • intelligent erasure

  • intelligent cropping

image.png

image.png

  • element detection

  • intelligent erasure

  • high-resolution upscaling

image.png

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

ImageUrl

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.

Ability

number[]

Yes

An array of AI capabilities to call. Multiple selections are allowed. For the enumerated values, see the table above. Example: [1, 2, 3, 4]

element detection (Ability=1)

ObjectDetectElements

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 NonobjectDetectElements cannot both be empty.

NonobjectDetectElements

number[]

One of two required

The elements to detect on the background. The valid values are the same as for ObjectDetectElements.

IsFilter

Boolean

Yes

Select whether to process images with this element (true) or without it (false).

intelligent matting (Ability=2)

BackGroundType

String

Yes

WHITE_BACKGROUND (white background) or TRANSPARENT (transparent background).

intelligent erasure (Ability=3)

ObjectRemoveElements

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 NonobjectRemoveElements cannot both be empty.

NonobjectRemoveElements

number[]

One of two required

The elements to remove from the background. The valid values are the same as for ObjectRemoveElements.

Mask

String

No

The RLE format precisely specifies the removal area. When this format is used, the ObjectRemoveElements / NonobjectRemoveElements parameters are ignored.

Image Translation Pro (Ability=4)

SourceLanguage

String

No

The source language code. For details, see Supported languages.

TargetLanguage

String

No

The target language code.

IncludingProductArea

Boolean

No

Specifies whether to translate the main body text. If set to false, only non-main body text is translated to protect embedded information such as product names.

TranslatingBrandInTheProduct

Boolean

No

Specifies whether to translate brand names. The default value is false.

Glossary

String

No

The glossary ID. For more information, see Glossary.

intelligent cropping (Ability=5)

TargetWidth

number

Yes

The target width in pixels. Valid values: 100–5000.

TargetHeight

number

Yes

The target height in pixels. Valid values: 100–5000.

high-resolution upscaling (Ability=6)

UpscaleFactor

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

Code

String

The status code. A successful operation returns "success".

Message

String

The error description. "Success" is returned if the request is successful.

Success

Boolean

Indicates whether the request was successful.

RequestId

String

The request ID. Provide this ID when troubleshooting.

Data.TaskId

String

The asynchronous task ID. Use this ID with the query API.

Query API

Request parameters

Parameter

Type

Required

Description

TaskId

String

Yes

The TaskId returned by the submission API.

Request example

{ "TaskId": "75942c08-1d09-942f-bfa9-76703872e668" }

Response parameters

Parameter

Type

Description

Code / Message / Success / RequestId

--

Same as the submit API.

Data.TaskId

String

The asynchronous task ID.

Data.Status

String

Task status: QUEUED (Queued) / IN_PROGRESS (In progress) / COMPLETED (Completed) / FAILED (Failed).

Data.Result

String (JSON)

Data.Result is a JSON string that must be parsed again (for example, by using JSON.parse). This parameter is returned only when the status is COMPLETED. The following Data.Result.Result.* represents the parsed structure.

Data.Result.Result.SrcUrl

String

The URL of the original input image.

Data.Result.Result.FinalUrl

String

The URL of the processed image. This is a signed OSS URL with an expiration time.

Data.Result.Result.ElementStatus

Boolean

Indicates whether the image passed the element detection check. This parameter is only meaningful when element detection (Ability=1) is enabled.

Data.Result.Result.ObjCharacter / ObjWatermark / ObjLogo / ObjNpx

String

Indicates whether the main subject contains text, watermarks, logos, or color blocks with text ("true" or "false").

Data.Result.Result.NoobjCharacter / NoobjWatermark / NoobjLogo / NoobjNpx

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 -- The ImageUrl is invalid (due to its resolution, size, or format), or the Ability parameter 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 (zh)

en (English), ja (Japanese), ko (Korean)

English (en)

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 (es)

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 (tr)

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 (zh-tw)

Via bridged translation: zh-tw→zh and zh-tw→zh→en. This indirectly covers all target languages available from English.

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

If one AI ability in the workflow fails, does the entire workflow fail? Will I be charged?

Yes, the entire workflow will fail. You will not be charged for the request because it failed.

Next steps