Smart erase (Asynchronous)
Overview
Smart Erase is a feature designed for e-commerce images. It automatically detects and removes text, specific names, transparent text blocks, and unwanted marks. You can also specify which objects to remove, enabling efficient and precise batch processing that simplifies your workflow.
Use cases
Efficient e-commerce image processing:
Remove distracting visual elements to create clearer, more focused product displays and enhance the customer shopping experience.
Cross-platform product information synchronization:
When listing products across different e-commerce platforms, you can quickly remove specific text and unwanted marks to comply with the image standards of each platform.
Marketing material preparation:
Easily remove old promotional information and update images with new campaign details.
Note: Businesses and platforms can batch-remove unwanted elements to optimize image quality. We recommend using this feature in combination with the Smart Recognition API (coming soon). First, use the Smart Recognition API to filter for images that contain text, specific names, transparent text blocks, or unwanted marks. Then, call the Smart Erase API to remove them in batches. The Smart Recognition API focuses on "recognition," while the Smart Erase API focuses on "removal." By calling them in sequence, you can improve accuracy and reduce errors.
How it works
First, understand the definitions of image subject and image background. When specifying objects to remove, you can choose whether the removal applies to the image subject or the image background. The service can be integrated via an API or used through an editor.
Image subject: The core product area within the image.
Image background: The rest of the image outside the image subject.
Second, you can specify what to remove in three ways:
By type: Select categories of elements to remove, such as text, specific names, transparent text blocks, and unwanted marks. Refer to the examples to determine the appropriate operation for your needs.
(New) By specific image: Specify one or more image elements to remove by providing their URLs.
(New) By specific text: Specify one or more text strings to remove.
Processing workflow: A user provides an original image URL → An Optical Character Recognition (OCR) and VLM model detects the location of text or image elements → The system determines the coordinates of the area to be inpainted → AI inpainting generates a clean image → The system returns the URL of the resulting image.
Before and after examples
Removable object type | Original image | Resulting image |
Text |
|
|
Specific names |
|
|
Transparent text blocks |
|
|
Unwanted marks |
|
|
Remove specified image elements (supports multiple image URLs) |
|
|
Remove specified text (supports multiple text strings) |
|
|
Developer guide
Request parameters
Parameter | Type | Required | Description |
ImageUrl | String | Yes | The URL of the original image. The image must be in JPG, JPEG, PNG, BMP, or WEBP format. The resolution must be between 256×256 and 3000x3000 pixels, and the file size must not exceed 10 MB. Example: |
ObjectRemoveElements | Number[] | No | The elements to remove from the image subject. You can select multiple element types. Valid values are: 1 (transparent text blocks), 2 (specific names), 3 (text), and 4 (unwanted marks). This parameter is optional; however, you must specify at least one of the following parameters: If multiple parameters are specified, the order of precedence is: For details on element types, see the product description. Image subject: The core product area in the image. Example: |
NonObjectRemoveElements | Number[] | No | The elements to remove from the image background. You can select multiple element types. Valid values are: 1 (transparent text blocks), 2 (specific names), 3 (text), and 4 (unwanted marks). This parameter is optional. For details on parameter precedence and requirements, see the description of For details on element types, see the product description. Example: |
Mask | String | No | The specific area to remove, specified in Run-Length Encoding (RLE) format. This parameter is typically used with an editor. If specified, this parameter takes precedence over This parameter is optional. For details on parameter precedence and requirements, see the description of Example: |
Position | String | No | The specific area to remove, specified as four-point coordinates, for example, For details on parameter precedence and requirements, see the description of |
UserText | String[] | No | The text strings to remove. You can specify multiple strings in the format For details on parameter precedence and requirements, see the description of |
UserImage | String[] | No | The URLs of image elements to find and remove. You can specify multiple image URLs in the format For details on parameter precedence and requirements, see the description of |
Request example
{
"ImageUrl": "https://aib-innovation-oss.oss-accelerate.aliyuncs.com/AI_Business/asTYo/removaltest2.png?Expires=3356502130&OSSAccessKeyId=LTAI5tE8X3gEy66SRU1V8dig&Signature=QI%2BNEcHO%2FNCMgNnx5lv%2B0JxQ7KE%3D",
"NonObjectRemoveElements": null,
"ObjectRemoveElements": [
1,
2,
4
],
"Mask": null,
"UserText": [
"Technology",
"Secret Weapon"
],
"UserImage": [
"xxxxxxxxx",
"xxxxxxxxx"
]
}Response parameters
Parameter | Type | Description |
Code | String | The status code, such as "success". |
Success | Boolean |
|
Message | String | An error message if the request fails, such as "The parameter contains sensitive information, please try other input." |
RequestId | String | The unique request ID. |
Data | Object | The object containing the result data. |
Data.ImageUrl | String | The URL of the processed image. |
Data.Width | Number | The width of the output image in pixels. |
Data.Height | Number | The height of the output image in pixels. |
Data.UsageMap | Object | An object containing usage data. |
Data.UsageMap.ProcessedImageCount | Number | The number of images processed. |
Response example
{
"Data": {
"ImageUrl": "http://dashscope-7c2c.oss-cn-shanghai.aliyuncs.com/7d/25/20260813/909f6051/feb09c19-e7f7-4b64-856d-0c83cac288b0.jpg?Expires=1789198273&OSSAccessKeyId=LTAI5tPxpiCM2hjmWrFXrym1&Signature=bXySUcguJBqgnVBnmtKHBTK4EhM%3D",
"Height": 896,
"UsageMap": {
"ProcessedImageCount": 1
},
"Width": 692
},
"RequestId": "019FFA08-2261-19C1-A546-0137FD063D3B",
"Message": "Success",
"Code": "success",
"Success": true
}Integration and invocation
Before you begin
Smart Erase supports both synchronous and asynchronous invocation modes. This document describes the asynchronous API. For the synchronous version, see Smart Erase.
This asynchronous API uses the same result retrieval process, RocketMQ subscription rules, message encryption protocol, dependency configurations, and Java consumer and decryption code as other asynchronous APIs.
For details on the integration process, subscription rules, message format, encryption protocol, and implementation for asynchronous calls, see Asynchronous API Call Instructions.
Billing
¥0.025 per image
Limitations
Invocation mode: Asynchronous. Default QPS = 5. The submission request timeout is 30 seconds.
Input image: Must be in JPG, JPEG, PNG, BMP, or WEBP format. The resolution must be between 256×256 and 3000×3000 pixels. The file size must be 10 MB or less.
Billing: Billed per item based on
ProcessedImageCount.
FAQ
If an object is obscured by text, can the service regenerate the obscured area after removing the text?
The service removes the specified content and performs basic color restoration, but it does not regenerate complex object details.
If the automatic removal result from the Smart Erase API is not satisfactory, is there a way to make manual adjustments?
Yes. If you integrate via the editor, you can make manual adjustments. In the editor, you can paint, box-select, or lasso the selection to remove. An editor console will be available later through Aidge to support these features.



















