Manual Image Remover
3/12/26About 2 min
Manual Image Remover
Mask-guided watermark removal for precise, user-controlled results. You provide a mask image marking the watermark regions; the API removes only those areas while preserving the rest.
Before you begin
Obtain your API key from API Key Settings before making requests.
Overview
| Item | Value |
|---|---|
| Endpoint | POST /api/unwatermark/api/v1/manual-unWaterMark |
| Auth | ZF-API-KEY header |
| Credits | 1 per request |
| Result availability | 24 hours |
Request
Headers
| Name | Required | Value |
|---|---|---|
ZF-API-KEY | Yes | Your API key |
Content-Type | Yes | multipart/form-data |
Body (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
original_image_file | file | Yes | Original image to process |
mask_image_file | file | Yes | Mask image — white regions mark watermark areas to remove, black regions are preserved |
Example
HTML
<!DOCTYPE html>
<html lang="en">
<body>
<label>Original Image: <input type="file" id="image" accept="image/*" /></label><br/>
<label>Mask Image: <input type="file" id="mask" accept="image/*" /></label><br/>
<button onclick="send()">Remove Watermark</button>
<pre id="out"></pre>
<script>
async function send() {
const image = document.getElementById('image').files[0];
const mask = document.getElementById('mask').files[0];
if (!image || !mask) return alert('Please select both files.');
const form = new FormData();
form.append('original_image_file', image);
form.append('mask_image_file', mask);
const res = await fetch(
'https://api.unwatermark.ai/api/unwatermark/api/v1/manual-unWaterMark',
{ method: 'POST', headers: { 'ZF-API-KEY': 'YOUR_API_KEY' }, body: form }
);
document.getElementById('out').textContent =
JSON.stringify(await res.json(), null, 2);
}
</script>
</body>
</html>Python
import requests
url = "https://api.unwatermark.ai/api/unwatermark/api/v1/manual-unWaterMark"
headers = {"ZF-API-KEY": "YOUR_API_KEY"}
with open("/path/to/image.jpg", "rb") as img, open("/path/to/mask.jpg", "rb") as mask:
response = requests.post(url, headers=headers, files={
"original_image_file": img,
"mask_image_file": mask,
})
print(response.json())Java
import okhttp3.*;
import java.io.File;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
OkHttpClient client = new OkHttpClient();
RequestBody body = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart(
"original_image_file", "image.jpg",
RequestBody.create(new File("/path/to/image.jpg"), MediaType.parse("image/jpeg"))
)
.addFormDataPart(
"mask_image_file", "mask.jpg",
RequestBody.create(new File("/path/to/mask.jpg"), MediaType.parse("image/jpeg"))
)
.build();
Request request = new Request.Builder()
.url("https://api.unwatermark.ai/api/unwatermark/api/v1/manual-unWaterMark")
.post(body)
.addHeader("ZF-API-KEY", "YOUR_API_KEY")
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
}
}
}PHP
<?php
$url = "https://api.unwatermark.ai/api/unwatermark/api/v1/manual-unWaterMark";
$apiKey = "YOUR_API_KEY";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["ZF-API-KEY: {$apiKey}"],
CURLOPT_POSTFIELDS => [
'original_image_file' => new CURLFile('/path/to/image.jpg'),
'mask_image_file' => new CURLFile('/path/to/mask.jpg'),
],
]);
$data = json_decode(curl_exec($curl), true);
curl_close($curl);
print_r($data);
Response
Success (100000)
{
"code": 100000,
"message": {
"en": "Image generated successfully.",
"zh": "图片生成成功。"
},
"result": {
"need_credits": 1,
"input_image_url": "https://xxxxxx.jpg",
"output_image_url": "https://xxxxxx.jpg"
}
}Error (400000)
{
"code": 400000,
"message": {
"en": "Request Failure",
"zh": "请求失败"
},
"result": null
}
Status Codes
| Code | Meaning |
|---|---|
100000 | Success |
400000 | Request failed |
