Image Watermark API
Add a text and / or logo watermark to JPEG or PNG photos: 9 positions or tiled diagonal text, opacity, size, margin; up to 20 images per call as a ZIP.
Upload an image as multipart file (or several files for a batch) with a watermark text, a logo (PNG with transparency or JPEG) or both. position is one of top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right or tile (the watermark repeated over the whole photo in staggered rows, rotated by rotation, default 30°). scale sets the watermark width as a share of the image width (default 0.3), opacity 0–1 or 0–100, margin a share of the shorter side, spacing the gap between tiles. Text uses Be Vietnam Pro (full Vietnamese) in color with a thin contrasting outline (stroke, outline=false to remove); with a logo and text the text is placed under the logo (layout=stack) or separately (text_position).
One image returns the image (same format, or format=png|jpeg, quality); several images return watermarked.zip. max_width resizes before watermarking. Limits: 25 megapixels per image, 100 MP and 20 images per request, and your plan's upload size. Images are processed in memory and not stored.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
file | body | file | yes | Image (JPEG / PNG); several files for a batch (any field names except logo), or file_base64 / images_base64. | |
text | body | string | no | Watermark text (max 200 characters). | |
logo | body | file | no | Logo image (PNG with transparency or JPEG). | |
position | body | string | no | bottom-right | Corner / edge / center, or tile. |
opacity | body | number | no | 0.6 | 0–1 (or 0–100). Default 0.3 for tile. |
scale | body | number | no | 0.3 | Watermark width / image width (0.01–1). |
margin | body | number | no | 0.03 | Margin as a share of the shorter side. |
rotation | body | number | no | Text rotation in degrees (−90…90; default 30 for tile). | |
color | body | string | no | #ffffff | Text colour (CSS). |
format | body | string | no | same (default), jpeg or png. |
Example
curl -X POST "https://apibox.io.vn/v1/image-watermark" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@./my-file" \
-o outputconst form = new FormData();
form.append('file', fileInput.files[0]);
const res = await fetch('https://apibox.io.vn/v1/image-watermark', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
body: form,
});
console.log(await res.json());import requests
res = requests.post(
"https://apibox.io.vn/v1/image-watermark",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"file": open("my-file", "rb")},
timeout=30,
)
open("output", "wb").write(res.content)<?php
$ch = curl_init('https://apibox.io.vn/v1/image-watermark');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
CURLOPT_POSTFIELDS => ['file' => new CURLFile('my-file')],
]);
$response = curl_exec($ch);
file_put_contents('output', $response);Response
binary image/jpeg
Use cases
- Stamp the shop name on product photos before posting
- Protect real-estate photos with a tiled watermark
- Add a logo to a batch of event photos
- Mark sample or draft images as "MẪU" / "DRAFT"
FAQ
Which formats are supported?
JPEG and PNG in and out. The logo can be a transparent PNG.
How do I watermark many images?
Send several files in the multipart request (up to 20); the response is a ZIP with one watermarked image per file.
Does Vietnamese text work?
Yes: the text is drawn from the Be Vietnam Pro font outlines, with all diacritics.
Related APIs
QR Code Generator
Generate QR codes as PNG or SVG with one GET request: URLs, text, WiFi logins, vCards, e-mail, SMS, phone and geo links. Custom colours, size and ECC.
|||Barcode Generator
Create Code 128 barcodes for labels, SKUs and shipping with a single request. SVG with human-readable text or PNG, custom height, width and colours.
▭Placeholder Image
Get placeholder images of any size for mockups and tests: /v1/placeholder/600x400.png. SVG with custom text and colours, or a solid-colour PNG.