Deepmark

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:

FieldDescription
embed_strengthWatermark strength, 110 (optional)
dark_suppressionDark region protection, 0.01.0 (optional)
dark_thresholdDark luminance threshold, 0255 (optional)
flat_area_retentionMinimum watermark in flat areas, 0.01.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):

TierImage heightTypical resolutions
≤480pup to 480 pixelsThumbnails, small previews
480–720p481 to 720 pixelsWeb images, social media
720–1080p721 to 1080 pixelsHD photos
>1080pabove 1080 pixelsFull-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.

RangeEffect
1Minimum 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.
10Maximum 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.

RangeEffect
0.0Off. Watermark is applied at full strength everywhere, including dark regions.
0.5Moderate. Watermark is reduced by half in regions below the dark threshold.
1.0Full suppression. Watermark is completely removed in the darkest regions.
Defaults by resolution tier
  1. ≤480p — 0.0
  2. 480–720p — 0.4
  3. 720–1080p — 0.6
  4. >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.

RangeEffect
0Only pure black pixels are protected.
40Pixels below ~16% brightness are protected.
127Pixels 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
  1. ≤480p — 0
  2. 480–720p — 40
  3. 720–1080p — 60
  4. >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.

RangeEffect
0.0Watermark 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.0No 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
  1. ≤480p — 0.7
  2. 480–720p — 0.6
  3. 720–1080p — 0.4
  4. >1080p — 0.3

Lower resolutions use higher retention because fewer pixels means less room for the watermark to hide.

Defaults Summary

Parameter≤480p480–720p720–1080p>1080p
embed_strength5555
dark_suppression0.00.40.60.95
dark_threshold04060127
flat_area_retention0.70.60.40.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)TilesGrid
< 5000 px4×416 tiles
≥ 5000 px8×864 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)

Watermarked (optimal)Passthrough (no watermark)
Passthrough (no watermark)
Watermarked (optimal)
<>
Loading images…

Detection: confidence ~97%, accuracy 100%, BCH OK. Tiles: 4×4.

~5000px (5K+)

Watermarked (optimal)Passthrough (no watermark)
Passthrough (no watermark)
Watermarked (optimal)
<>
Loading images…

Detection: confidence ~94%, accuracy 100%, BCH OK. Tiles: 8×8.

~8000px (8K)

Watermarked (optimal)Passthrough (no watermark)
Passthrough (no watermark)
Watermarked (optimal)
<>
Loading images…

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

Watermark delta visualization — ~1920px
100%

~5000px

Watermark delta visualization — ~5000px
100%

~8000px

Watermark delta visualization — ~8000px
100%

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

  1. JPEG (.jpg, .jpeg)
  2. PNG (.png)
  3. 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.