A lightweight tool for detecting and removing Content Authenticity Initiative (C2PA) metadata from image files.
$ dotnet add package C2PARemover.CliA command-line tool for detecting and removing C2PA (Content Authenticity Initiative) metadata from JPEG and PNG images.
# Install from NuGet
dotnet tool install -g C2PARemover.Cli
# Or install from a local package
dotnet tool install -g --add-source ./nupkg C2PARemover.Cli
# Build the tool
dotnet build C2PARemover.Cli/C2PARemover.Cli.csproj
# Run directly
dotnet run --project C2PARemover.Cli/C2PARemover.Cli.csproj -- check image.jpg
c2paremover check image.jpg
Output:
✓ No C2PA metadata found (exit code 0)⚠️ C2PA metadata detected (exit code 1)c2paremover remove image.jpg
This creates a cleaned copy as image.jpg.cleaned.jpg and verifies the removal.
c2paremover check-dir /path/to/directory
Scans all JPEG and PNG files in the directory and reports which ones contain C2PA metadata.
# Pack the tool
dotnet pack C2PARemover.Cli/C2PARemover.Cli.csproj -c Release
# The package will be created in: C2PARemover.Cli/bin/Release/C2PARemover.Cli.1.0.0.nupkg
# Publish to NuGet.org (requires API key)
dotnet nuget push C2PARemover.Cli/bin/Release/C2PARemover.Cli.1.0.0.nupkg --api-key YOUR_API_KEY --source https://api.nuget.org/v3/index.json
# Create package
dotnet pack C2PARemover.Cli/C2PARemover.Cli.csproj -c Release
# Install from local package
dotnet tool install -g --add-source ./C2PARemover.Cli/bin/Release C2PARemover.Cli
dotnet tool update -g C2PARemover.Cli
dotnet tool uninstall -g C2PARemover.Cli
# Check a single image
c2paremover check photo.jpg
# Remove C2PA from an image
c2paremover remove photo.jpg
# Creates: photo.jpg.cleaned.jpg
# Check all images in a directory
c2paremover check-dir ./images
0 - Success (no C2PA found, or removal successful)1 - C2PA detected, or error occurred