mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Reconcile every tool page's parameters, defaults, and response shape against the tool's Zod settings schema and executionHint in code. Notable fixes: color-palette (add count + format params, hex output, median-cut algorithm), favicon (add 5 params, was documented as having none), qr-generate (add logoDataUri), convert (add ppm/eps/tga formats), video-loudnorm (-16 LUFS not -14), smart-crop (async 202 not sync 200), images-to-video (1080x1080 square), and several output-filename and behavior-note corrections. Also normalize API endpoint paths to /api/v1/tools/<id> (no modality segment) and standardize curl examples on the Docker API port 1349. Verified with a clean docs build.
2.0 KiB
2.0 KiB
description
| description |
|---|
| Overlay a logo or image as a watermark with configurable position, opacity, and scale. |
Image Watermark
Overlay a logo or secondary image as a watermark on a base image. The watermark is scaled relative to the base image width and positioned at a corner or center.
API Endpoint
POST /api/v1/tools/watermark-image
Accepts multipart form data with two image files and a JSON settings field.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| position | string | No | "bottom-right" |
Watermark placement: center, top-left, top-right, bottom-left, bottom-right |
| opacity | number | No | 50 |
Watermark opacity percentage (0 to 100) |
| scale | number | No | 25 |
Watermark width as percentage of main image width (1 to 100) |
File Fields
| Field Name | Required | Description |
|---|---|---|
| file | Yes | The main/base image |
| watermark | Yes | The watermark/logo image |
Example Request
curl -X POST http://localhost:1349/api/v1/tools/watermark-image \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@photo.jpg" \
-F "watermark=@logo.png" \
-F 'settings={"position": "bottom-right", "opacity": 60, "scale": 20}'
Example Response
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/photo.jpg",
"originalSize": 2450000,
"processedSize": 2520000
}
Notes
- Both images are validated and decoded (HEIC, RAW, PSD, SVG supported).
- The watermark is resized proportionally so its width equals
scale% of the main image width. - Opacity is applied via an alpha mask composited with
dest-inblending. - Corner positions use a 20px padding from the image edge.
- If the watermark image has transparency (e.g., a PNG logo), it is preserved during compositing.
- EXIF orientation is auto-applied on both images before processing.