Skip to content
Projects

863401402/image-provenance

View on GitHub

About

AI image detector and watermark disruption toolkit (client-side, WIP)

Design & Media

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+1
in 15 days
+1
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.en.md

Original

Image Provenance

Pages License Client-side

中文 · English

AI image provenance tool. Runs 100% in your browser — your image never leaves your device.

👉 Open the live demo


Preview

Detection main view

Conversion before/after

What it does

  • Multi-layer detection — C2PA / Content Credentials, Google SynthID, OpenAI DALL·E / Sora, Midjourney, Stable Diffusion / Flux, Adobe Firefly and more. Each detection carries a strong/medium/weak confidence tag, and only strong/medium signals flip the top verdict to "HIT".
  • Metadata viewer — Full EXIF / XMP / IPTC / ICC breakdown, GPS with a privacy warning + OSM link, and the complete XMP editing-history timeline.
  • Frequency analysis — 65 features extracted inside a Web Worker, a viridis FFT heatmap, normalized radial power spectrum, and a multi-family anomaly heuristic.
  • Image conversion — Byte-level C2PA strip → EXIF orientation normalization → transparent pixels composited over white → Canvas re-encode → optional watermark processing → camera EXIF injection.
  • Watermark disruption v2 — 8 techniques (including a real 2D-FFT phase perturbation) across 4 presets (Light / Recommended / Strong / Extreme). No rotation, no flip, no aspect-ratio change.
  • Local batch processing — Add multiple images for quick/full detection or conversion, cancel/retry jobs, and export CSV, JSON, or a manifest-backed ZIP. Images remain on the device.

Stack

Zero build. A single HTML file plus ES Modules. The official C2PA WebAssembly verifier is vendored; exifr, piexifjs, and fflate load from a CDN only when needed. FFT / DCT / DWT, watermark techniques, and frequency features run locally in the browser.

Batch mode and browser API

Switch the left pane to Batch and add JPEG, PNG, or WebP files. Quick detection runs with concurrency 2; full detection and conversion use concurrency 1 to bound Canvas and FFT memory. A queue accepts up to 200 jobs, including no more than 50 conversions. Quick mode checks provenance and metadata, while Full mode also runs frequency analysis.

Self-hosted integrations can call the structured analyzer directly:

import { analyzeImage } from './src/analyzer.js';

const { report, details } = await analyzeImage(file, { mode: 'full' });
console.log(report.verdict, report.c2pa, report.frequency);

Batch conversion uses convertFile() from src/batch/converter.js and returns a JPEG Blob, output name, dimensions, effective quality, camera profile, and processing log. See docs/TECHNICAL-NOTES.md for implementation rationale.

Run locally

git clone https://github.com/863401402/image-provenance
cd image-provenance
python3 -m http.server 8000   # open http://localhost:8000
npm test                      # run Node unit tests

ES Modules + Web Workers require HTTP — file:// will not load.

Accuracy & ethics

This is not a calibrated classifier. Corvi et al. 2023 documents spectral and spatial anomalies in generated imagery, while AIDE 2024 shows that off-the-shelf detectors still fail heavily on realistic, unseen generated images. Frequency output therefore describes anomaly strength, not proof of AI generation; verified C2PA provenance should take priority.

Watermark disruption is for research: privacy de-identification and academic robustness evaluation. Not endorsed for disinformation, impersonation, or fraud. Position aligned with WAVES (NeurIPS 2024).

Community

Open a GitHub Issue for bug reports / feature requests, or start a Discussion for broader questions.

License

MIT

Explore related projects

Loading…