ghostimg

command module
v0.0.0-...-53e698e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 5 Imported by: 0

README

ghostimg

Remove all forms of AI-generator identification from images — from obvious metadata to statistical pixel fingerprints.

What it removes

Layer What is removed
1 — Obvious metadata C2PA/JUMBF, EXIF, XMP, IPTC, ICC Profile, timestamps, comments
2 — Container chunks/segments All non-essential PNG chunks; JPEG APP1–APP14; WEBP EXIF/XMP/ICCP RIFF chunks
3 — Text fingerprints References to ChatGPT, DALL-E, Midjourney, Stable Diffusion, Adobe Firefly embedded in text payloads
4 — Statistical fingerprint ±1–2 RGB perturbation per pixel — invisible to the eye, disrupts frequency-domain detectors (Hive, AI-or-Not, etc.)

Dependencies

Only one dependency: golang.org/x/image — the official Go extended standard library maintained by the Go team. It provides the WEBP decoder. No third-party packages.

Build

git clone https://github.com/10yearsahead/ghostimg
cd ghostimg
go mod tidy
go build

Usage

# Single file — flags accepted in any order
./ghostimg photo.png
./ghostimg photo.png -v
./ghostimg -v photo.png

# Custom output path
./ghostimg -o result.png photo.png

# Process entire directory
./ghostimg -dir ./photos -o ./photos_clean

# Skip pixel perturbation layer
./ghostimg -no-pixel photo.jpg

Notes

  • WEBP output is saved as PNG — Go's stdlib has no WEBP encoder, and the format conversion itself breaks WEBP-specific frequency fingerprints
  • Pixel perturbation uses a fixed seed for reproducibility; replace with time.Now().UnixNano() in internal/perturb/perturb.go for different output on each run
  • C2PA manifests with cryptographic signatures are fully removed, not merely invalidated

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
formats
Package formats routes images to their format-specific processing pipeline.
Package formats routes images to their format-specific processing pipeline.
perturb
Package perturb applies imperceptible pixel-level noise to break the statistical fingerprints left by AI image generators.
Package perturb applies imperceptible pixel-level noise to break the statistical fingerprints left by AI image generators.
repack
Package repack handles clean re-encoding of images.
Package repack handles clean re-encoding of images.
stripper
Package stripper removes metadata at the binary/container level, before any image decode step.
Package stripper removes metadata at the binary/container level, before any image decode step.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL