Invisible, crypto-verified, AI-training-resilient image watermarks
Project description
Sigil Watermark
Invisible, crypto-verified, AI-training-resilient image watermarks. A pure signal-processing system — no neural networks, no training infrastructure, no GPU required.
Features
- Invisible: 40+ dB PSNR on real photographs and artwork (adaptive embedding strength)
- Crypto-verified: Ed25519 keypairs with HKDF-derived parameters — each watermark is cryptographically unique
- Three independent layers: DFT ring anchor, DWT spread-spectrum payload, ghost spectral signal
- Robust: Survives JPEG compression (Q60+), resize, crop, rotation, noise, bilateral filtering
- VAE-resilient: Ghost signal layer survives Stable Diffusion VAE encode/decode
- False positive rate: < 10^-30 (analytically proven, empirically validated)
- Fast: Pure NumPy/SciPy — embeds a 1024x1024 image in ~200ms on CPU
- Typed: Full PEP 561 compliance with type annotations
Installation
pip install sigil-watermark
Quick Start
import numpy as np
from sigil_watermark import SigilEmbedder, SigilDetector, generate_author_keys
# Generate author keypair (or derive from a seed for reproducibility)
keys = generate_author_keys()
# Load your image as a float64 array (0-255), grayscale or RGB
image = np.array(Image.open("artwork.png").convert("RGB"), dtype=np.float64)
# Embed watermark
embedder = SigilEmbedder()
watermarked = embedder.embed(image, keys)
# Save (the watermark survives JPEG, PNG, and other formats)
Image.fromarray(np.clip(watermarked, 0, 255).astype(np.uint8)).save("watermarked.png")
# Detect watermark
detector = SigilDetector()
result = detector.detect(watermarked, keys.public_key)
print(f"Detected: {result.detected}") # True
print(f"Author match: {result.author_id_match}") # True
print(f"Confidence: {result.confidence:.3f}") # ~0.7
Architecture
Sigil embeds three independent watermark layers, each targeting a different attack class:
┌─────────────────────────────────┐
│ Input Image │
└──────────────┬──────────────────┘
│
┌──────────────▼──────────────────┐
│ Layer 1: DFT Ring Anchor │
│ 8 concentric frequency rings │
│ (key-derived + sentinel + content)│
│ Survives: rotation, crop, scale │
└──────────────┬──────────────────┘
│
┌──────────────▼──────────────────┐
│ Layer 2: DWT Spread-Spectrum │
│ RS-encoded payload in wavelets │
│ Tiled for crop robustness │
│ Survives: JPEG, noise, resize │
└──────────────┬──────────────────┘
│
┌──────────────▼──────────────────┐
│ Layer 3: Ghost Spectral Signal │
│ Multiplicative modulation at │
│ VAE-transparent frequency bands │
│ Survives: VAE encode/decode │
└──────────────┬──────────────────┘
│
┌──────────────▼──────────────────┐
│ Watermarked Image │
│ PSNR: 35-47 dB │
└─────────────────────────────────┘
Detection is three-tier:
- Beacon — "Is this a Sigil watermark?" (universal marker)
- Author Index — "Whose watermark is it?" (20-bit index for blind scanning)
- Author Verification — "Cryptographic proof of authorship" (48-bit author ID)
Documentation
- Getting Started — Tutorial with examples
- API Reference — Full API documentation
- Technical Design — Deep dive into the signal processing
Development
git clone https://github.com/AI-Escape/sigil-watermark.git
cd sigil-watermark
uv sync --extra dev
uv run pytest # ~1,900 tests (GPU/slow excluded by default)
uv run pytest -n auto # parallel execution
uv run ruff check . # lint
uv run ruff format --check # format check
GPU tests
Some tests require a GPU with PyTorch and diffusers installed:
uv sync --extra gpu
uv run pytest -m gpu # real SD VAE encode/decode, LoRA propagation
Building docs locally
uv sync --extra docs
uv run mkdocs serve # http://127.0.0.1:8000
Origin
Sigil Watermark was originally developed as part of the Signarture artist protection platform.
License
Apache-2.0 — see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sigil_watermark-0.2.0.tar.gz.
File metadata
- Download URL: sigil_watermark-0.2.0.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76afc57396f0c4336fd3e8f583d5591b379f81f5621d9c9071635b5c3123e9d4
|
|
| MD5 |
01f0b99322027a6f8d14546cef09945f
|
|
| BLAKE2b-256 |
bed82d83cb8daf8327e50e3bbb5b2fdd2f167c537549bd44dc4e30d1298d2bf6
|
Provenance
The following attestation bundles were made for sigil_watermark-0.2.0.tar.gz:
Publisher:
publish.yml on AI-Escape/sigil-watermark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sigil_watermark-0.2.0.tar.gz -
Subject digest:
76afc57396f0c4336fd3e8f583d5591b379f81f5621d9c9071635b5c3123e9d4 - Sigstore transparency entry: 1071781429
- Sigstore integration time:
-
Permalink:
AI-Escape/sigil-watermark@d43f5a04c39f1bc38c43837d57e58745d67c0c30 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AI-Escape
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d43f5a04c39f1bc38c43837d57e58745d67c0c30 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sigil_watermark-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sigil_watermark-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbfcab76710f0a79955c248aab79f9d4f36c830bbe1a64b4f41a7ccfbbb3e6da
|
|
| MD5 |
3f0f56825e01b035a228f868161bacfc
|
|
| BLAKE2b-256 |
12b709b2c300b13061a874776fd1c1e1795d11cee55ae85dad3ff1e54ea26745
|
Provenance
The following attestation bundles were made for sigil_watermark-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on AI-Escape/sigil-watermark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sigil_watermark-0.2.0-py3-none-any.whl -
Subject digest:
fbfcab76710f0a79955c248aab79f9d4f36c830bbe1a64b4f41a7ccfbbb3e6da - Sigstore transparency entry: 1071781526
- Sigstore integration time:
-
Permalink:
AI-Escape/sigil-watermark@d43f5a04c39f1bc38c43837d57e58745d67c0c30 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AI-Escape
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d43f5a04c39f1bc38c43837d57e58745d67c0c30 -
Trigger Event:
release
-
Statement type: