A lightweight tool for detecting and removing Content Authenticity Initiative (C2PA) metadata from image files. Available as both a CLI tool and a WebAssembly module.
C2PA (Coalition for Content Provenance and Authenticity) is a metadata standard used to track the origin and edit history of media content. While it serves legitimate purposes in combating misinformation and deepfakes, it also raises privacy concerns as it can contain identifiable information about the device that created an image and its user.
# Requires Go 1.24.2 or later
git clone https://github.com/ngmisl/C2PAremover.git
cd C2PAremover
go build -o c2paremover .
The project includes a Makefile to simplify building:
# Build native binary
make build
# Build WebAssembly binary
make wasm
# Build both
make all
# Install to system (requires sudo for /usr/local/bin)
sudo make install
# Install using Wasmer
wasmer install metaend/c2paremover
# Or run directly from Wasmer.io registry
wasmer run metaend/c2paremover@0.1.5
# Check and remove C2PA metadata from a single file
c2paremover input.jpg output.jpg
# Process multiple files
c2paremover input1.jpg output1.jpg input2.png output2.png
# Check directory (creates cleaned copies with "_clean" suffix)
c2paremover -d /path/to/directory
# Check if an image has C2PA metadata without removing it
c2paremover check input.jpg
The WASM module reads from stdin and writes to stdout:
# Process a single file
cat input.jpg | wasmer run c2paremover > cleaned.jpg
# Process Adobe test file with C2PA metadata
cat adobe-20220124-CAICA.jpg | wasmer run metaend/c2paremover > cleaned.jpg
# Process and chain with other tools
cat input.jpg | wasmer run c2paremover | convert - -resize 800x600 output.jpg
The WebAssembly version offers several advantages:
go build .
GOOS=wasip1 GOARCH=wasm go build -o c2paremover.wasm -tags=wasmer .
# Build all targets
make all
The tool performs the following operations:
Contributions are welcome! Please feel free to submit a Pull Request.
View on GitHub