A browser extension and web tool that scrambles images to increase the cost of AI scraping, using a keyless self-contained detection system.
- Smart Scrambling: Divides images into 64 tiles (8Γ8 grid) and shuffles them deterministically
- Auto-Detection: Scrambled images can be automatically detected and unscrambled - no keys needed!
- Self-Contained: All encoding information is embedded in the image itself via a marker column
- Browser Extension: Automatically unscramble images while browsing
- Web App: Standalone tool for scrambling/unscrambling without installing anything
- 72 Unique Patterns: Uses seed-based shuffling with 72 possible combinations
- Image Division: Original image is divided into an 8Γ8 grid (64 tiles)
- Shuffling: Tiles are shuffled using a deterministic seed-based algorithm
- Marker Column: A 9th column is added containing:
- 7 black tiles
- 1 "negative" tile (inverted RGB of the original first tile)
- Encoding: The position of the marker column (1-9) and the negative tile (1-8) encode the seed
- Result: A 9Γ8 scrambled image that contains all information needed for unscrambling
Column Position (C): 1-9 (where marker column is inserted)
Negative Position (N): 1-8 (row of negative tile within marker column)
Seed = (C - 1) Γ 8 + N
Range: 1 to 72
- Check if image has 9:8 aspect ratio
- Scan columns to find the marker (7 black + 1 non-black tile)
- Extract seed from marker position
- Regenerate shuffle pattern and reverse it
- Verify by comparing inverted negative tile with reconstructed first tile
- Reconstruct original 8Γ8 image
No build step required! The extension works out-of-the-box:
-
Clone or download this repository:
git clone https://github.com/agbuddy7/image-scrambler.git cd image-scrambler -
Load in Chrome:
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
extension/folder
- Open
That's it! No npm install or npm run build needed.
The web app is available at web-app/index.html or can be tested using test-manual.html in the root directory. Simply open these files in your browser - no build step required!
Scrambling Images:
- Click the extension icon
- Upload or drag-and-drop an image
- Click "Scramble Image"
- Download the scrambled result
Auto-Unscrambling:
- The extension automatically detects and unscrambles images as you browse
- Unscrambled images show a π badge
- Configure settings in the Options page
Scramble Tab:
- Upload an image
- Click "Scramble Image"
- View encoding information
- Download scrambled image
Unscramble Tab:
- Upload a scrambled image
- Click "Unscramble Image"
- View detection and verification status
- Download original image
image-scrambler/
βββ core/ # Core scrambling engine (source)
β βββ prng.js # Seeded PRNG (Mulberry32)
β βββ canvas-utils.js # Image manipulation helpers
β βββ scrambler.js # Main scramble logic
β βββ detector.js # Detection logic
β βββ unscrambler.js # Reverse scramble logic
βββ extension/ # Browser extension (no build needed!)
β βββ core/ # Core files (copied for self-contained extension)
β βββ manifest.json # Chrome MV3 manifest
β βββ popup/ # Extension popup
β βββ content/ # Content scripts
β βββ background/ # Service worker
β βββ options/ # Options page
βββ web-app/ # Standalone web tool
β βββ index.html
β βββ app.js
β βββ styles.css
βββ tests/ # Unit tests
βββ scrambler.test.js
βββ detector.test.js
No Build Required: The extension and core files use vanilla JavaScript (no ES6 modules) to work directly in browsers without any build step. Simply edit the files and reload the extension.
Building (Optional): For the web app or if you want to bundle files:
# Install dependencies (only if using webpack)
npm install
# Production build
npm run build
# Development build with watch mode
npm run watch# Run all tests
npm test
# Run tests in watch mode
npm run test:watch- Load image into canvas
- Calculate tile dimensions:
tileWidth = width/8,tileHeight = height/8 - Extract 64 tiles into array
- Generate random column position (1-9) and negative position (1-8)
- Calculate seed:
seed = (columnPosition - 1) * 8 + negativePosition - Use seeded PRNG with Fisher-Yates shuffle
- Create negative tile:
RGB = 255 - originalRGB - Assemble 9Γ8 output with marker column
- Quick aspect ratio check (9:8 β 1.125)
- For each column, check if it matches marker pattern
- Black tile detection: average RGB < 10
- Extract seed from marker position
- Return detection result
- Detect scrambled image and extract seed
- Extract 64 scrambled tiles (skip marker column)
- Generate same shuffle map using seed
- Create and apply reverse shuffle map
- Verify: invert negative tile and compare with first tile (95% threshold)
- Assemble original 8Γ8 image
Uses the Mulberry32 algorithm for deterministic pseudo-random number generation:
- Fast and efficient
- Good statistical properties
- Same seed always produces same sequence
- Perfect for reproducible shuffling
What it does:
- Increases cost of bulk AI scraping
- Requires custom code to unscramble at scale
- Protects casual browsing from automated scrapers
What it doesn't do:
- Provide cryptographic security
- Stop determined attackers
- Prevent manual reconstruction
- Protect against reverse engineering
Use Cases:
- Personal photos on social media
- Portfolio images from bulk scrapers
- Reducing unauthorized dataset collection
- Making scraping more expensive
- Chrome/Edge: Full support (Manifest V3)
- Firefox: Requires manifest adaptation
- Safari: Requires manifest adaptation
Contributions are welcome! Please feel free to submit issues or pull requests.
MIT License - See LICENSE file for details
- Mulberry32 PRNG algorithm
- Canvas API for image manipulation
- Chrome Extension APIs
Note: This tool is designed to increase the cost of bulk scraping, not to provide absolute protection. Use it as one layer in a comprehensive content protection strategy.