Metadata-Version: 2.4
Name: universal-ai-watermark-remover
Version: 0.1.0
Summary: Universal AI watermark remover, deep neural inpainter, and provenance metadata scrubber by White Way Web.
Author: White Way Web
License-Expression: MIT
Project-URL: Homepage, https://github.com/whitewayweb/Universal-AI-Watermark-Remover
Project-URL: Documentation, https://github.com/whitewayweb/Universal-AI-Watermark-Remover#readme
Project-URL: Repository, https://github.com/whitewayweb/Universal-AI-Watermark-Remover.git
Keywords: watermark-remover,ai,lama,c2pa,inpainting,metadata-scrubber,synthid,steganography
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pillow>=9.0.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: opencv-python-headless>=4.5.0
Requires-Dist: click>=8.0.0
Requires-Dist: piexif>=1.1.3
Provides-Extra: ai
Requires-Dist: torch>=2.0.0; extra == "ai"
Requires-Dist: transformers>=4.40.0; extra == "ai"
Requires-Dist: simple-lama-inpainting>=0.1.0; extra == "ai"
Requires-Dist: accelerate>=0.26.0; extra == "ai"
Provides-Extra: gui
Requires-Dist: pywebview>=4.0.0; extra == "gui"
Provides-Extra: all
Requires-Dist: universal-ai-watermark-remover[ai,gui]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Dynamic: license-file

# Universal AI Watermark Remover

> **Universal Deep Learning AI Watermark Remover and Provenance Metadata Scrubber.**  
> Developed and Maintained by **[White Way Web](https://github.com/whitewayweb)**.

[![PyPI Version](https://img.shields.io/badge/pypi-universal--ai--watermark--remover-blue.svg)](https://pypi.org/project/universal-ai-watermark-remover/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-brightgreen.svg)](https://python.org)
[![Neural Engine: LaMA](https://img.shields.io/badge/Neural%20Engine-LaMA%20Big-purple.svg)](https://github.com/advimman/lama)

---

## Side-by-Side Inpainting Studio

Experience seamless, zero-blur watermark removal powered by **Large Mask Inpainting (LaMA)** deep neural networks with interactive canvas masking:

<p align="center">
  <img src="docs/images/studio_demo.png" alt="Universal AI Watermark Remover Side-by-Side Studio" width="95%" style="border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);">
</p>

*Above: Real OpenAI Sora video frame with top-left watermark erased cleanly using LaMA neural synthesis.*

---

## Key Features

1. **Neural Network Inpainting (LaMA)**:
   * Replaces blurred OpenCV approximations with **LaMA (Large Mask Inpainting)** Fourier Convolutions (`big-lama.pt`).
   * Synthesizes authentic image textures (sky, clouds, fur, backgrounds) with zero smudging.
2. **Complete C2PA and Provenance Metadata Scrubbing**:
   * Scans raw binary byte streams for `b"c2pa"` and `b"jumb"` chunks.
   * Completely strips cryptographic provenance manifests (DALL-E 3, Adobe Firefly, ChatGPT) verified on official **[contentcredentials.org/verify](https://contentcredentials.org/verify)**.
3. **AI Text and Document Steganography Sanitizer**:
   * Detects and strips invisible Unicode watermarks (zero-width spaces `\u200B`, joiners `\u200D`, BOM `\uFEFF`, bidi overrides `\u202A-\u202E`, and tag characters).
   * Sanitizes documents (Markdown, Plain Text, DOCX, ODT, HTML).
4. **Interactive Side-by-Side Web Studio**:
   * Draw precise masks over any watermark with an adjustable brush slider or 1-click Auto Mask.
   * Instant side-by-side preview with download capabilities.
5. **Invisible Watermark Neutralization (SynthID)**:
   * Neutralizes frequency-domain digital watermarks via Fast Fourier Transform (FFT) sub-band filtering.
6. **Full Video Inpainting Pipeline**:
   * Processes frame sequences with audio pass-through via FFmpeg.

---

## Quickstart and Installation

### Option 1: Standard PyPI Installation

```bash
# Basic Core Package (includes Text, Documents, and Metadata engines)
pip install universal-ai-watermark-remover

# Full Neural Network and AI Dependencies (PyTorch + LaMA)
pip install "universal-ai-watermark-remover[ai]"
```

### Option 2: Install Directly from GitHub into Any Project

```bash
# Basic package
pip install git+https://github.com/whitewayweb/Universal-AI-Watermark-Remover.git

# Full Neural Network and AI Dependencies (PyTorch + LaMA)
pip install "universal-ai-watermark-remover[ai] @ git+https://github.com/whitewayweb/Universal-AI-Watermark-Remover.git"
```

Or add to your project's `requirements.txt`:
```text
universal-ai-watermark-remover[ai]
```

### Option 3: Run / Develop from Source

```bash
git clone https://github.com/whitewayweb/Universal-AI-Watermark-Remover.git
cd Universal-AI-Watermark-Remover

# Create virtual environment and install in editable mode
python3 -m venv venv
source venv/bin/activate
pip install -e ".[all]"
```

---

## Launch Interactive Web Studio

Launch the built-in side-by-side studio in your browser with a single command:

```bash
universal-ai-watermark-remover web --port 8080
```
Open **[http://127.0.0.1:8080](http://127.0.0.1:8080)** to paint over watermarks and remove them in real-time.

---

## Integrate into Your Python Projects

You can easily embed `Universal-AI-Watermark-Remover` into your own applications, web backends, or data pipelines:

```python
from ai_watermark_remover import WatermarkRemover

# Initialize unified remover
remover = WatermarkRemover(use_gpu=False)

# 1. Remove visible watermarks with LaMA Neural Inpainting
remover.remove_visible(
    input_path="watermarked_image.jpg",
    output_path="cleaned_image.png",
    manual_boxes=[(25, 45, 240, 150)],  # Optional: (x1, y1, x2, y2)
    method="lama"
)

# 2. Strip C2PA and EXIF provenance metadata (verified on contentcredentials.org)
remover.strip_metadata(
    input_path="dalle3_image.png",
    output_path="c2pa_free_image.png"
)

# 3. Clean AI text (strips zero-width chars, bidi overrides, and tracking tags)
clean_text = remover.clean_text("AI-generated text with hidden \u200B\u200C tracking...")
print(clean_text)

# 4. Sanitize documents (DOCX, Markdown, Plain Text, HTML)
remover.clean_document(
    input_path="ai_draft.docx",
    output_path="sanitized_draft.docx"
)

# 5. Neutralize invisible watermarks (Google SynthID / Steganography)
remover.perturb_invisible(
    input_path="synthid_image.png",
    output_path="clean_synthid.png",
    method="fft"
)

# 6. Process an entire AI video (preserving audio)
remover.process_video(
    input_path="sora_video.mp4",
    output_path="clean_sora_video.mp4",
    detection_skip=5
)
```

---

## Command Line Interface (CLI)

```bash
# 1. Remove visible watermark with LaMA
universal-ai-watermark-remover remove-visible input.png output.png --method lama

# 2. Strip C2PA provenance metadata
universal-ai-watermark-remover strip-metadata input.png output.png

# 3. Clean AI text / Markdown
universal-ai-watermark-remover clean-text draft.md clean_draft.md

# 4. Sanitize documents (DOCX, ODT, HTML, TXT)
universal-ai-watermark-remover clean-doc report.docx clean_report.docx

# 5. Inspect media or text for watermarks
universal-ai-watermark-remover inspect draft.md
universal-ai-watermark-remover inspect photo.jpg

# 6. Neutralize invisible watermarks (SynthID)
universal-ai-watermark-remover perturb-invisible input.png output.png --method fft

# 7. Process video file
universal-ai-watermark-remover process-video input.mp4 output.mp4 --skip 5
```

---

## Repository Structure

```
Universal-AI-Watermark-Remover/
├── ai_watermark_remover/
│   ├── core/
│   │   ├── visible.py      # LaMA neural network inpainting & box masking
│   │   ├── metadata.py     # Binary C2PA, JUMBF & EXIF scrubber
│   │   ├── text.py         # Unicode steganography & document cleaner
│   │   ├── invisible.py    # FFT frequency & spatial noise perturber
│   │   └── video.py        # FFmpeg video frame sequence pipeline
│   ├── gui/
│   │   └── server.py       # Side-by-side interactive canvas studio
│   ├── api.py              # Unified WatermarkRemover API class
│   └── cli.py              # Click command-line interface
├── docs/
│   └── images/
│       └── studio_demo.png # Studio screenshot
└── examples/
    ├── sample_images/      # Real Sora, Stock & C2PA samples
    └── sample_documents/   # Real AI Markdown, DOCX & Text samples
```

---

## License and Attribution

Licensed under the [MIT License](LICENSE).  
Developed and maintained with pride by **[White Way Web](https://github.com/whitewayweb)**.
