Image Watermarking
Overview
This page covers image-specific features of the DeepMark watermarking API: quality settings that control the robustness/visibility tradeoff, spatial tiling, visual comparisons, and supported image formats.
For general API usage (authentication, submitting jobs, downloading results), see the API Key Guide.
Quality Settings
Quality settings control the tradeoff between watermark robustness (how well the watermark survives compression, cropping, screenshots) and visual quality (how invisible the watermark is).
The system automatically selects optimal defaults based on the input image's resolution. You only need to override the parameters you want to change — everything else uses the defaults for your image's resolution tier.
How to pass quality settings
Include quality settings as additional form fields in the POST /client/embed request:
| Field | Description |
|---|---|
embed_strength | Watermark strength, 1–10 (optional) |
dark_suppression | Dark region protection, 0.0–1.0 (optional) |
dark_threshold | Dark luminance threshold, 0–255 (optional) |
flat_area_retention | Minimum watermark in flat areas, 0.0–1.0 (optional) |
Example Request (with quality settings)
curl -sS -X POST "https://<your-deepmark-domain>/client/embed" \
-H "X-Client-Api-Key: <your-api-key>" \
-F "file=@/path/to/input.jpg" \
-F "watermark=10101010" \
-F "model=model-id" \
-F "embed_strength=4" \
-F "dark_suppression=0.8" \
-F "dark_threshold=80" \
-F "flat_area_retention=0.5"Each parameter has different defaults depending on which resolution tier the input image falls into (based on the longest side):
| Tier | Image height | Typical resolutions |
|---|---|---|
| ≤480p | up to 480 pixels | Thumbnails, small previews |
| 480–720p | 481 to 720 pixels | Web images, social media |
| 720–1080p | 721 to 1080 pixels | HD photos |
| >1080p | above 1080 pixels | Full-resolution photos, print |
Parameters
1. embed_strength
Controls how strongly the watermark signal is blended into the image. This is the primary knob for the robustness vs. visibility tradeoff.
| Range | Effect |
|---|---|
| 1 | Minimum strength. Watermark is barely visible but fragile — may not survive heavy compression or screenshotting. |
| 5 (default) | Balanced. Watermark is imperceptible in most content and survives standard compression workflows. |
| 10 | Maximum strength. Watermark survives aggressive transformations but may produce visible artifacts. |
Range:1 to 10. Default: 5 for all resolutions.
2. dark_suppression
Controls how much the watermark is reduced in dark regions of the image. Dark areas have less perceptual headroom to hide the watermark, so without suppression, artifacts become visible as noise or banding in shadows.
| Range | Effect |
|---|---|
| 0.0 | Off. Watermark is applied at full strength everywhere, including dark regions. |
| 0.5 | Moderate. Watermark is reduced by half in regions below the dark threshold. |
| 1.0 | Full suppression. Watermark is completely removed in the darkest regions. |
Defaults by resolution tier
- ≤480p —
0.0 - 480–720p —
0.4 - 720–1080p —
0.6 - >1080p —
0.95
Higher resolutions use stronger protection because dark-region artifacts are more noticeable on large displays.
3. dark_threshold
Controls the luminance threshold below which a region is treated as dark for the purposes of dark_suppression. Higher values mean more of the image is considered dark and receives suppression.
| Range | Effect |
|---|---|
| 0 | Only pure black pixels are protected. |
| 40 | Pixels below ~16% brightness are protected. |
| 127 | Pixels below ~50% brightness are protected — roughly the darker half of the image. |
This parameter works together with dark_suppression — it defines where protection applies, while dark_suppression defines how much.
Defaults by resolution tier
- ≤480p —
0 - 480–720p —
40 - 720–1080p —
60 - >1080p —
127
4. flat_area_retention
Controls the minimum watermark strength retained in smooth, flat areas — regions with low texture like sky, walls, gradients, and solid backgrounds. These areas have very little visual complexity to mask the watermark, making artifacts more noticeable.
| Range | Effect |
|---|---|
| 0.0 | Watermark can be fully suppressed in flat areas. Best visual quality in gradient-heavy content, but watermark is very weak in those regions. |
| 0.4 (default) | Watermark is reduced to 40% strength in flat areas. Good balance between visual quality and robustness. |
| 1.0 | No reduction. Flat areas receive the same watermark strength as textured areas. Maximum robustness but artifacts may be visible in skies, walls, and gradients. |
Defaults by resolution tier
- ≤480p —
0.7 - 480–720p —
0.6 - 720–1080p —
0.4 - >1080p —
0.3
Lower resolutions use higher retention because fewer pixels means less room for the watermark to hide.
Defaults Summary
| Parameter | ≤480p | 480–720p | 720–1080p | >1080p |
|---|---|---|---|---|
embed_strength | 5 | 5 | 5 | 5 |
dark_suppression | 0.0 | 0.4 | 0.6 | 0.95 |
dark_threshold | 0 | 40 | 60 | 127 |
flat_area_retention | 0.7 | 0.6 | 0.4 | 0.3 |
Tiling
For large images, the watermark is embedded using spatial tiling — the image is divided into a grid and each tile is watermarked independently. This improves robustness against cropping (each tile carries the full watermark) and ensures consistent quality regardless of resolution.
| Image dimension (max side) | Tiles | Grid |
|---|---|---|
| < 5000 px | 4×4 | 16 tiles |
| ≥ 5000 px | 8×8 | 64 tiles |
Tiling is handled automatically — no client configuration is needed.
Visual Comparison
The following examples demonstrate watermark quality across different resolutions. Each comparison shows a passthrough re-encode (same decode→JPEG encode pipeline, no watermark) alongside the watermarked output, so any visual difference is purely from the watermark — not from codec re-compression.
Original vs. Optimally Watermarked
Drag the slider to compare the original image with its watermarked version. The watermark is designed to be imperceptible to the human eye while remaining detectable by the system.
~1920px (Full HD)


Detection: confidence ~97%, accuracy 100%, BCH OK. Tiles: 4×4.
~5000px (5K+)


Detection: confidence ~94%, accuracy 100%, BCH OK. Tiles: 8×8.
~8000px (8K)


Detection: confidence ~98%, accuracy 100%, BCH OK. Tiles: 8×8.
With resolution-adaptive defaults, the watermark is visually imperceptible. Dark regions are protected from noise artifacts, flat areas like sky and gradients retain smooth appearance, and the watermark signal is concentrated in textured regions where the human eye is least sensitive.
Watermark Delta Visualization
The images below show |watermarked − passthrough| amplified 30× and rendered as white on black. Both images went through the same JPEG encode pipeline, so the difference is purely from the watermark. Brighter pixels indicate stronger watermark energy.
~1920px
~5000px
~8000px
The watermark signal is distributed uniformly across the image. The consistent pattern demonstrates that the perceptual masking adapts to image content — watermark energy is suppressed in dark and flat regions and concentrated in textured areas where it is least visible.
Image Format Support
Supported Formats
- JPEG (.jpg, .jpeg)
- PNG (.png)
- WebP (.webp)
Supported Resolutions
From 256×256 up to 16K (16384×16384) pixels. Images outside this range may be rejected or automatically resized.
Watermark Length
The image watermark payload supports up to 256 bits. If the provided watermark is shorter than 256 bits, it is automatically tiled (repeated) to fill the full capacity. Detection recovers the full 256-bit payload and folds it back to the original length via majority voting, which improves detection reliability.
Output Format
The watermarked image is returned in the same format as the input. JPEG quality is preserved at the source level to minimize re-compression artifacts.



