Smart Removal
Smart Removal optimizes e-commerce images by automatically detecting and removing elements such as text, specific names, transparent text blocks, and visual clutter. You can specify which objects to remove to process large batches of images efficiently and accurately, simplifying your image editing workflow. This is a synchronous API.
Use cases
Efficiently process e-commerce images: Remove distracting visual elements to create cleaner, more focused product displays and enhance the customer shopping experience.
Synchronize product listings across multiple platforms: Quickly remove specific text and visual clutter to meet each platform's image guidelines.
Prepare marketing assets: Easily remove old promotional information from images to update them for new campaigns.
Layer metadata (editor protocol): After you enable
UseImageEditor, the response returns additional layout metadata such as the text position, font, and color. You can use this data for secondary editing. For the full field reference, see Image Translation Editor Protocol.
Merchants and platforms can bulk-remove unwanted elements to improve image quality. For best results, use this service with Intelligent Element Recognition. First, use Intelligent Element Recognition to identify images that contain text, a specific name, a transparent text block, or visual clutter. Then, use the Smart Removal API to remove these elements in batches. For scenarios where you do not need to remove all detected elements, you can provide a list of specific text strings to be removed.
Intelligent Element Recognition focuses on detection, while Smart Removal focuses on removal. Calling these services in sequence maximizes removal effectiveness and reduces the risk of incorrect removals or identifications. If you need to perform both steps in a single, orchestrated workflow, you can use Intelligent Image Generation.
Supported elements for removal
Enum value | Description | Typical example |
| Transparent text block | Monochromatic transparent text or semi-transparent color blocks, typically used as watermarks. |
| Specific name | Brand names, store names, or custom keywords. |
| Text | Horizontal, vertical, or slanted text in Chinese or English. |
| Visual clutter | Promotional copy, exaggerated decorative elements, or fake certification badges, including colored text blocks. |
The service distinguishes between two types of regions: the image subject (the core product area) and the image non-subject (the background and other areas). The ObjectRemoveElements parameter controls removal on the image subject, and the NonObjectRemoveElements parameter controls removal on the image non-subject. You can configure both parameters independently.
Additionally, you can precisely specify text or image elements to remove using the UserText and UserImage parameters, or manually define the removal area using Mask and Position for more granular control.
How it works
The service differentiates between two main areas of an image, allowing you to apply removal operations to a specific area. You can integrate the service through an API or an editor to meet different requirements.
Image subject: The core product area in the image.
Image non-subject: The rest of the image, excluding the subject.
You can specify elements for removal in three ways:
By element type: Select from predefined types, such as text, specific names, transparent text blocks, or visual clutter. Use the examples to determine the best options for your use case.
By providing a sample image: Specify one or more images of the elements you want to remove.
By providing specific text: Specify one or more text strings to remove.
The processing workflow is as follows: You provide an image URL. The service uses Optical Character Recognition (OCR) and Vision Language Models (VLMs) to locate elements, determines which areas to inpaint, generates a clean image using AI, and returns its URL.
Before-and-after examples
Text
Region | Original image | Resulting image |
On the image subject |
|
|
On the image non-subject |
|
|
Specific name
Region | Original image | Resulting image |
On the image subject |
|
|
On the image non-subject |
|
|
Transparent text block
Region | Original image | Resulting image |
On the image subject |
|
|
On the image non-subject |
|
|
Visual clutter
Region | Original image | Resulting image |
On the image subject |
|
|
On the image non-subject |
|
|
Specified objects
Removal type | Original image | Resulting image |
Removing specified image elements (multiple image URLs supported) |
|
|
Removing specified text (multiple text strings supported) |
|
|
API
POST /rest/ai/image/removeQuick start
import json
# Removes transparent text blocks, specific names, and visual clutter from the non-subject area only.
data = json.dumps({
"ImageUrl": "https://example.com/product-with-watermark.jpg",
"NonObjectRemoveElements": [1, 2, 4]
})
result = make_signed_request("/rest/ai/image/remove", data)
d = result["Data"]
print("Resulting image:", d["ImageUrl"])
print("Output dimensions:", d["Width"], "x", d["Height"])For complete instructions on signing requests, SDK examples in Java, Python, and Go, and online debugging, visit the Alibaba Cloud OpenAPI Developer Portal: Smart Removal API (OpenAPI Portal).
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 256x256 and 3000x3000 pixels, and the file size must not exceed 10 MB. Example: |
ObjectRemoveElements | Number[] | No | An array of element types to remove from the image subject (1=transparent text block; 2=specific name; 3=text; 4=visual clutter). You can select multiple types. This parameter is optional, but you must specify at least one of the following parameters: If multiple parameters are specified, the order of precedence is: For details about each type, see the Supported elements for removal table. The image subject is the core product area in the image. Example: |
NonObjectRemoveElements | Number[] | No | An array of element types to remove from the image non-subject (1=transparent text block; 2=specific name; 3=text; 4=visual clutter). You can select multiple types. This parameter is optional, but you must specify at least one of the following parameters: If multiple parameters are specified, the order of precedence is: For details about each type, see the Supported elements for removal table. Example: |
Mask | String | No | Specifies the removal area. This parameter is typically used with an editor. The input must be in RLE encoding. This parameter is optional, but you must specify at least one of the following parameters: If multiple parameters are specified, the order of precedence is: Example: |
Position | String | No | Specifies the removal area by using four-point coordinates, such as If multiple parameters are specified, the order of precedence is: |
UserText | String[] | No | Specifies the text to remove. You can provide multiple text strings in an array, such as If multiple parameters are specified, the order of precedence is: |
UserImage | String[] | No | The links to the image elements that you want to remove. You can specify multiple links in the format [" If multiple parameters are specified, the order of precedence is: |
RLE encoding is a space-separated string of start-pixel and length pairs, following the COCO mask convention. The coordinate system origin is the top-left corner of the image.
Response fields
Field | Type | Description |
| String | The business status code. A value of |
| String | The unique ID of the request. |
| String | The returned message. A value of |
| Boolean | Indicates whether the request was successful. |
| Object | The data structure of the returned result. |
| String | The URL of the resulting image after processing. This is a signed OSS URL. |
| Number | The width of the output image in pixels. Same as the original image. |
| Number | The height of the output image in pixels. Same as the original image. |
| Object | The usage information. |
| Number | The number of processed images, which is used for billing. |
Examples
Request example
{
"ImageUrl": "https://aib-innovation-oss.oss-accelerate.aliyuncs.com/AI_Business/asTYo/removaltest2.png?Expires=3356502130&OSSAccessKeyId=LTAI*****",
"NonObjectRemoveElements": null,
"ObjectRemoveElements": [
1,
2,
4
],
"Mask": null,
"UserText": [
"Technology",
"Secret Weapon"
],
"UserImage": [
"https://example.com/element-to-remove-1.png",
"https://example.com/element-to-remove-2.png"
]
}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=LTAI*****",
"Height": 896,
"UsageMap": {
"ProcessedImageCount": 1
},
"Width": 692
},
"RequestId": "019FFA08-2261-19C1-A546-0137FD063D3B",
"Message": "Success",
"Code": "success",
"Success": true
}Usage notes
Remove elements from the non-subject area only: Primary product images often require removing only background promotional text, while keeping labels on the product itself. For this use case, specify only the
NonObjectRemoveElementsparameter.Handle large text on the subject: For images with large text on the subject, such as a brand logo on a T-shirt, direct removal can damage the subject. Use Intelligent Element Recognition to evaluate the image before attempting removal.
Precisely remove a specific area: If automatic detection does not accurately cover the target element, such as an irregularly shaped watermark, you can specify the exact removal area by using the
Maskparameter.Remove specific image elements or text: When you know exactly which elements to remove, use the
UserImageparameter to pass their URLs (multiple supported) or theUserTextparameter to pass the text strings (multiple supported). The system automatically locates and removes the specified content, so you do not need to manually define a removal area.
Error codes
Error code | Cause |
| The image format, resolution, or size is out of range. |
| The input image failed the content moderation review. |
| The service failed to download the image, or a downstream vision model is temporarily unavailable. Retry the request using an exponential backoff strategy. |
| Your free trial quota has been used up. You need to purchase a resource plan or disable the 'Stop After Expiration' setting. |
| Server-side internal error. Please save the |
For a complete list of error codes, see Error codes.
Limitations
Invocation mode: Synchronous. The default queries per second (QPS) is 5, and the maximum request timeout is 30 seconds.
Input image: Supported formats are JPG, JPEG, PNG, BMP, and WEBP. The resolution must be between 256×256 and 3000×3000 pixels. The file size must not exceed 10 MB.
Mask mode: When
Maskis passed, the subject/non-subject enumeration removal parameters are ignored. Not all three can be empty.Billing: ¥0.025 per image, based on the
ProcessedImageCountvalue. For more information, see Asset Optimization Billing.
FAQ
Next steps
Intelligent Element Recognition: The first step in a 'detect-then-remove' workflow.
Intelligent Matting: Extract the image subject after removing unwanted elements.



















