I was sending some photos to a friend and realized I had no idea what metadata was baked into them. Checked with exiftool and sure enough, GPS coordinates, phone model, exact timestamp, lens info. All sitting right there in the file.
Some platforms strip this stuff when you upload. Some don't. And if you send photos as files in a messenger, nothing gets removed.
So I wrote a Python script to handle it. I called it ZeroExif.
The main thing I wanted was to pick what gets removed. Sometimes I just want to kill the GPS data but keep everything else. Sometimes I want to nuke all of it. So there are four modes you can toggle:
Everything (EXIF, XMP, ICC profiles). This is what I use most of the time.
Just GPS coordinates.
Just camera and lens info.
Just dates and timestamps.
You can mix and match.
One problem I ran into early: if you just strip EXIF from a JPEG, the photo can end up sideways or upside down. The orientation was stored in the metadata. So the script applies the rotation physically before cleaning. Your photos stay the way they should.
For JPEG it saves at quality 95 with subsampling 0, so you're not losing quality.
It also handles animated GIFs and WebPs properly. Keeps all the frames, timing, loop count. Most quick Pillow solutions I found online just destroy the animation.
Works with JPG, PNG, WebP, BMP, TIFF.
You can drag photos or a whole folder into the terminal. It remembers which files you excluded last time. If a file with the same name already exists in the output folder, it adds _1, _2 etc.
Only dependency is Pillow. There's a Termux version too. Three languages (EN, RU, CN).
https://github.com/Datvex/ZeroExif
MIT license. Happy to hear any feedback.
Top comments (0)