Skip to main content

Sigil Watermark

PyPI version CI Python 3.12+ License: Apache-2.0

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:

  1. Beacon — "Is this a Sigil watermark?" (universal marker)
  2. Author Index — "Whose watermark is it?" (20-bit index for blind scanning)
  3. Author Verification — "Cryptographic proof of authorship" (48-bit author ID)

Documentation

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.

Metadata

Release files for sigil-watermark 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sigil-watermark 0.2.0
File Size Uploaded Provenance
sigil_watermark-0.2.0.tar.gz 3.0 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sigil-watermark 0.2.0
File Interpreter ABI Platform
sigil_watermark-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.0 MB

Release files / sigil_watermark-0.2.0.tar.gz

Download URL sigil_watermark-0.2.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
76afc57396f0c4336fd3e8f583d5591b379f81f5621d9c9071635b5c3123e9d4
BLAKE2b-256 checksum
How to use checksums
bed82d83cb8daf8327e50e3bbb5b2fdd2f167c537549bd44dc4e30d1298d2bf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Release files / sigil_watermark-0.2.0-py3-none-any.whl

Download URL sigil_watermark-0.2.0-py3-none-any.whl
Size 38.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbfcab76710f0a79955c248aab79f9d4f36c830bbe1a64b4f41a7ccfbbb3e6da
BLAKE2b-256 checksum
How to use checksums
12b709b2c300b13061a874776fd1c1e1795d11cee55ae85dad3ff1e54ea26745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Security for sigil-watermark 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sigil_watermark-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page