Remove Watermark
Automatically identify and remove watermarks, logos, or other unwanted overlay elements from an image, or remove specified areas directly. For semi-transparent or grid watermarks that cover the whole image, use Redraw mode to regenerate the image.
Create Task
Basic Information
| Item | Value |
|---|---|
| Request Method | POST |
| Request Path | /task/image_purify |
| Content-Type | application/json |
| Authentication | Raw API key in the Authorization header |
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file_id | string | Yes | - | Uploaded image file ID |
purify_method | string | No | "inpaint" | Method: inpaint (Repair: finds the watermark and repairs only that area) / redraw (Redraw: an image-editing model regenerates the whole image; priced separately, see Redraw mode) |
purify_scope | string | No | "full_screen" | Cleanup scope: full_screen (identify and remove automatically) / region (remove the boxes given by regions directly) |
regions | array | Required when region | - | Areas to remove directly, 1–16 boxes, each {"x","y","w","h"} as 0-1 frame ratios, with w>0, h>0, x+w≤1, y+h≤1 |
Request Example
curl -X POST https://api.ai-mcn.tv:10000/task/image_purify \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id": "537489015178246"}'
region mode example (remove the logo in the top-left corner):
curl -X POST https://api.ai-mcn.tv:10000/task/image_purify \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_id": "537489015178246",
"purify_scope": "region",
"regions": [{"x": 0.02, "y": 0.02, "w": 0.15, "h": 0.08}]
}'
regionmode does no recognition — everything inside the box is processed, including the main subject. Use it for dark logos or graphic stickers that cannot be recognized; smaller boxes that fit the element tightly give better results.
Redraw Mode
With purify_method set to redraw, an image-editing model regenerates the whole image without the watermark, which also clears semi-transparent or grid watermarks that cover the image or overlap the subject:
curl -X POST https://api.ai-mcn.tv:10000/task/image_purify \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id": "537489015178246", "purify_method": "redraw"}'
- Scope: with
purify_scopeset tofull_screen, the whole image is replaced by the redrawn result; withregion, only the inside of the boxes is replaced and pixels outside stay identical to the original (with a few pixels of blending at the box edges).regionsfollows the same format and checks as above. - Output: a JPG the same size as the original. The picture is regenerated, so fine details such as small text or textures may differ slightly from the original.
- Pricing: the task type is recorded as
image_purify_redrawand charged at the "Image Watermark Removal · Redraw" tier of the price list, with no free runs. Creating and querying still go through/task/image_purify. - Data handling: the image is sent to a third-party model service outside mainland China for processing.
- Time: usually 30–60 seconds.
- Failures: if the model service's content review refuses the image, the task fails with error code
6054, is not retried, and the credits are refunded. Other upstream failures are retried automatically, and credits are refunded if the task still fails. Redraw never falls back to Repair results.
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"task_type": "image_purify",
"status": "queued"
}
}
When purify_method is redraw, task_type is image_purify_redraw.
Query Task Result
Basic Information
| Item | Value |
|---|---|
| Request Method | GET |
| Request Path | /task/image_purify/{task_id} |
| Authentication | Raw API key in the Authorization header |
Output Result (output_result)
| Parameter | Type | Description |
|---|---|---|
file_id | string | Processed image file ID |
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"status": "completed",
"progress": 100,
"output_result": {
"file_id": "537489015178248"
},
"create_time": "2026-04-05T08:00:00Z",
"update_time": "2026-04-05T08:00:08Z"
}
}
AI-Generated Content Label
Results of the redraw mode (purify_method=redraw) carry an implicit AI-generated content label (file metadata only; the picture is unchanged). See AI-Generated Content Labels. The inpaint mode adds no Gitruck Cloud label and keeps any label already in your upload.
Error Codes
| Error Code | HTTP Status | Description | Resolution |
|---|---|---|---|
6013 | 400 | Missing file_id | Pass the file_id field |
6016 | 400 | Invalid purify_method or purify_scope, or missing or invalid regions in region mode (empty, more than 16 boxes, or out-of-range coordinates) | Check purify_method / purify_scope / regions |
6014 | 400 | File type does not match the task | Upload an image file |
6004 | 404 | File not found | Verify the file_id |
6017 | 400 | The file is not a recognizable image (for example, a web page saved as .jpg, or a file whose header is cut off). It is rejected at task creation; no task is created and nothing is charged | Re-export the image as JPEG / PNG and upload it again |
6502 | 401 | Authentication failed | Check the Authorization header |
6202 | 402 | Insufficient balance | Recharge in the Dashboard |
6054 | — | In Redraw mode, the image was refused by the model service's content review (during execution: the task fails and credits are refunded; see error_code in the task result) | Use a different image, or switch to Repair |
6017 | — | In Repair mode, the image's actual format can't be read by this API (for example, the extension is .jpg but the content is AVIF); the error message names the actual format (during execution: the task fails and credits are refunded; see error_code in the task result) | Convert the image to JPEG / PNG, upload it again and resubmit |
6021 | — | The image data is incomplete or damaged, typically truncated by an interrupted download or upload. The file header is intact, so this can't be detected at task creation (during execution: the task fails and credits are refunded; see error_code in the task result) | Re-export the image or use the original, then resubmit |