Install
openclaw skills install deai-imageDetect and remove AI fingerprints from AI-generated images. Strip metadata, add film grain, recompress, and bypass AI image detectors. Works with Midjourney,...
openclaw skills install deai-imageComprehensive CLI for removing AI detection patterns from AI-generated images. Transforms detectable AI images into human-camera-like photographs using multiple processing techniques.
Supported Models: Midjourney, DALL-E 3, Stable Diffusion, Flux, Firefly, Leonardo, and more.
# Basic processing (medium strength)
python scripts/deai.py input.png
# Specify output file
python scripts/deai.py input.png -o output.jpg
# Adjust processing strength
python scripts/deai.py input.png --strength heavy
# Only strip metadata (fastest)
python scripts/deai.py input.png --no-metadata
# Batch process directory
python scripts/deai.py input_dir/ --batch
# Pure Bash version (no Python needed)
bash scripts/deai.sh input.png output.jpg
AI-generated images contain multiple detection layers:
Our de-fingerprinting pipeline applies 7 transformation stages:
Input → Metadata Strip → Grain Addition → Color Adjustment →
Blur/Sharpen → Resize Cycle → JPEG Recompress → Final Metadata Clean → Output
| Stage | Purpose | Technique |
|---|---|---|
| Metadata Strip | Remove EXIF/C2PA/JUMBF tags | ExifTool |
| Grain Addition | Add camera sensor noise | Poisson/Gaussian noise overlay |
| Color Adjustment | Break color distribution patterns | Contrast/saturation/brightness tweak |
| Blur/Sharpen | Disrupt edge detection patterns | Gaussian blur + unsharp mask |
| Resize Cycle | Introduce resampling artifacts | Downscale → upscale with Lanczos |
| JPEG Recompress | Add compression artifacts | Quality 75 → 95 cycle |
| Final Clean | Ensure no metadata leakage | ExifTool re-run |
Choose strength based on detection risk vs quality tradeoff:
| Strength | Description | Success Rate | Quality Loss |
|---|---|---|---|
light | Minimal processing, preserve quality | 35-45% | Very low |
medium | Balanced (default) | 50-65% | Low |
heavy | Aggressive processing | 65-80% | Medium |
Success rate = percentage of images passing common AI detectors (Hive, Illuminarty, AI or Not)
# Default medium strength
python scripts/deai.py ai_portrait.png
# Light processing for high-quality images
python scripts/deai.py artwork.png --strength light -o clean_artwork.jpg
# Heavy processing for stubborn detection
python scripts/deai.py midjourney_out.png --strength heavy
# Process entire directory
python scripts/deai.py ./ai_images/ --batch -o ./cleaned/
# Batch with specific strength
python scripts/deai.py ./gallery/*.png --batch --strength heavy
# Only strip metadata (instant, no quality loss)
python scripts/deai.py image.jpg --no-metadata
# No Python/Pillow needed, pure ImageMagick + ExifTool
bash scripts/deai.sh input.png output.jpg
# Specify strength
bash scripts/deai.sh input.png output.jpg heavy
bash scripts/check_deps.sh
This will verify all dependencies and provide installation commands if missing.
Debian/Ubuntu:
sudo apt update
sudo apt install -y imagemagick libimage-exiftool-perl python3 python3-pip
pip3 install Pillow numpy
macOS:
brew install imagemagick exiftool python3
pip3 install Pillow numpy
Fedora/RHEL:
sudo dnf install -y ImageMagick perl-Image-ExifTool python3-pip
pip3 install Pillow numpy
python scripts/deai.py <input> [options]
Arguments:
input Input image file or directory (batch mode)
Options:
-o, --output FILE Output file path (default: input_deai.jpg)
--strength LEVEL Processing strength: light|medium|heavy (default: medium)
--no-metadata Only strip metadata, skip image processing
--batch Process entire directory
-q, --quiet Suppress progress output
-v, --verbose Show detailed processing steps
Examples:
python scripts/deai.py image.png
python scripts/deai.py image.png -o clean.jpg --strength heavy
python scripts/deai.py folder/ --batch
bash scripts/deai.sh <input> <output> [strength]
Arguments:
input Input image file
output Output file path
strength light|medium|heavy (default: medium)
Examples:
bash scripts/deai.sh input.png output.jpg
bash scripts/deai.sh input.png output.jpg heavy
| Detector | Method | Bypass Rate |
|---|---|---|
| Hive Moderation | Deep learning model | 50-70% (medium) |
| Illuminarty | Computer vision analysis | 60-75% (medium) |
| AI or Not | Binary classification | 55-70% (medium) |
| SynthID | Pixel-level watermark | 35-50% (heavy) |
| C2PA Verify | Metadata check | 100% (metadata strip) |
❌ Not a Silver Bullet:
❌ Limitations:
✅ What It DOES Do:
Process Image:
python scripts/deai.py ai_image.png -o clean.jpg --strength medium
Test on Multiple Detectors:
If Still Detected:
--strength heavyQuality Check:
Edit scripts/deai.py to adjust parameters:
# Noise strength (line ~80)
noise = np.random.normal(0, 3, img_array.shape) # Increase 3 → 5 for more grain
# Contrast adjustment (line ~95)
enhancer.enhance(1.05) # Increase 1.05 → 1.08 for stronger effect
# JPEG quality (line ~120)
img.save(temp_path, "JPEG", quality=80) # Decrease 80 → 70 for more compression
# Step 1: De-fingerprint
python scripts/deai.py ai_gen.png -o step1.jpg
# Step 2: Add subtle texture overlay (GIMP/Photoshop)
# (Manual step)
# Step 3: Re-strip metadata
exiftool -all= step1_edited.jpg
medium strength (good balance)light (preserve quality)heavy for stress testing⚠️ Use Responsibly:
This tool is intended for:
DO NOT use for:
Legal Risks:
You are responsible for compliance with applicable laws and terms of service.
# Install ExifTool
sudo apt install libimage-exiftool-perl # Debian/Ubuntu
brew install exiftool # macOS
pip3 install Pillow numpy
# Edit /etc/ImageMagick-7/policy.xml
# Change: <policy domain="coder" rights="none" pattern="PNG" />
# To: <policy domain="coder" rights="read|write" pattern="PNG" />
# Pre-resize before processing
magick large.png -resize 2048x2048\> resized.png
python scripts/deai.py resized.png
# Use light strength
python scripts/deai.py input.png --strength light
# Test dependency check
bash scripts/check_deps.sh
# Test single image (verbose)
python scripts/deai.py test_images/sample.png -v
# Test batch mode
mkdir test_output
python scripts/deai.py test_images/ --batch -o test_output/
Improvements welcome! Focus areas:
Detection Research:
Open Source Projects:
Detection Tools:
Version: 1.0.0
License: MIT (for educational/research use)
Maintainer: voidborne-d
Last Updated: 2026-02-23