Python tools to automatically strip metadata (EXIF, GPS, device model, timestamps, etc.) from photos and screenshots — protecting sensitive information like your location.
Photos taken with a phone often carry EXIF metadata, including the exact GPS coordinates of where the photo was taken. When you share those photos (social media, messaging apps, forums), you might unintentionally reveal where you live, work, or spent your day.
This project offers two ways to handle that:
clean_metadata.py— runs once, processing an entire folder (and subfolders).watch_metadata.py— runs continuously in the background, watching folders and automatically cleaning every new image that appears.
git clone https://github.com/your-username/metadata-protector.git
cd metadata-protector
pip install -r requirements.txtRequires Python 3.8+.
python src/clean_metadata.py "C:\Users\YourUser\Pictures"By default, this creates cleaned copies inside a no_metadata/ subfolder without touching the original files.
To overwrite the original files directly:
python src/clean_metadata.py "C:\Users\YourUser\Pictures" --overwrite- Open
src/watch_metadata.pyand edit theWATCHED_FOLDERSlist with the folders you want to watch. - Run:
python src/watch_metadata.pyThe script stays active, and every time a new image lands in one of the configured folders (including subfolders), its metadata gets stripped automatically.
-
Create a file named
start_watcher.vbswith the content below (adjust the paths):Set objShell = CreateObject("WScript.Shell") objShell.Run "pythonw.exe C:\path\to\src\watch_metadata.py", 0, False
-
Press
Win + R, typeshell:startup, and press Enter. -
Place a shortcut to
start_watcher.vbsinside that folder.
This way, the watcher launches automatically when Windows starts, with no console window visible.
JPG, JPEG, PNG, WEBP, TIFF, BMP.
- This removes metadata from the file (EXIF/GPS/etc.), but does not edit the visual content of the image. If an address, license plate, or document is visible in the photo itself, that needs to be removed manually (cropping, blurring, etc.), since it isn't metadata.
- It's recommended to test on a sample folder first before using
--overwriteor leaving the watcher active on folders with important files.
MIT — see LICENSE.