Can You Batch Remove Metadata from Images? What We Measured on This Machine
Yes — and it is almost embarrassingly easy. On this machine (2026-11-13, Python 3.13 + Pillow 12.3.0 + piexif 1.1.3) we took a folder of 6 JPEGs carrying 24 EXIF fields each — camera make, a GPS fix, copyright, the lot — and cleared every one of them with a plain loop. The whole batch took about 0.15–0.18 seconds. Both methods dropped all 144 EXIF fields to zero and removed every GPS coordinate; the real difference is what they leave behind. piexif.remove() is lossless (the image pixels were byte-for-byte identical afterward) but it leaves a separate XMP block in place. A Pillow re-export strips EXIF and XMP, but it re-encodes the photo, so the pixels change. The honest answer to “can you batch-strip metadata” is yes — you just pick your method by what you want to keep. For the baseline this builds on, see do screenshots have exif data.
The short version
You do not need a special “batch” tool. A folder of photos is just a list of files, and stripping metadata is a per-file operation you run in a loop. The only real choice is how you strip it, because different methods keep or drop different things:
- EXIF (camera, GPS, dates, copyright): always removable, by every method.
- XMP (a second, separate metadata block): survives a surgical EXIF strip, but goes with a full re-export.
- The pixels themselves: stay identical with a metadata-only strip; change with a re-encode.
So “batch remove metadata” really means “batch remove metadata while deciding what else you are willing to touch.” The rest of this page is the test that backs that up.
What we actually tested, on 2026-11-13
Same engine as our other metadata work: Python 3.13 with Pillow 12.3.0 and piexif 1.1.3. The plan was concrete:
- Generate a folder of 6 JPEGs at mixed resolutions (1200×800 up to 2400×1600), each carrying 24 EXIF fields — IFD0 (Make, Model, Software, DateTime, Copyright, Artist, Orientation), Exif (DateTimeOriginal, exposure, aperture, ISO, focal length, dimensions, lens), and GPS (latitude, longitude, altitude) — plus a separate XMP block with a rights statement.
- Run a batch strip with piexif.remove() over all 6 files.
- Run a batch re-export with Pillow (open, save, pass no exif/xmp) over the same 6 files.
- Measure, per file: EXIF field count, GPS presence, copyright string, XMP presence, file size, and whether the pixels changed.
Every number below came from that run. Nothing is quoted from a blog post.
Finding 1: a loop clears a whole folder in milliseconds
The “batch” part is not the hard part. The entire loop over 6 images finished in 0.177 seconds with piexif.remove() and 0.147 seconds with the Pillow re-export. A real camera roll of a few hundred photos is still sub-second per method. If a tool stalls on a batch, it is not the metadata removal that is slow — it is something else (upload, UI, thumbnail generation). In code, the whole operation is three lines repeated per file:
for p in folder:
piexif.remove(p) # or: Image.open(p).save(p, "JPEG")
Finding 2: piexif.remove() wipes every EXIF field, losslessly
Before the strip, each image carried 24 EXIF fields; across 6 images that is 144 fields. After piexif.remove(), every image reported 0 fields — 144 down to 0. Specifically removed: the GPS fix on all 6 images, the Copyright string (© 2026 Jane Doe), and the camera Make (CameraCo). Critically, the image pixels were unchanged: we hashed the raw pixel data before and after, and the MD5 was identical. This is a metadata-only operation — it edits the file's sidecar data, not the picture. For why a screenshot never carries this kind of data in the first place, see do screenshots have exif data.
Finding 3: the catch — piexif.remove() leaves XMP behind
EXIF lives in one block (an APP1 segment). XMP lives in a different APP1 segment. piexif.remove() only knows about the EXIF block, so in our test the XMP rights statement survived on all 6 of 6 images after the strip. If you care about XMP — it often carries editing history, rights, and camera raw settings — a surgical EXIF strip does not clear it. You need a method that rewrites the whole file, which is exactly what the next test shows.
Finding 4: a Pillow re-export clears EXIF and XMP, but re-encodes
When we opened each image and saved it again without passing the exif or xmp data, the result was: 0 EXIF fields and 0 XMP blocks on all 6 images. GPS, copyright, camera, and the XMP rights statement were all gone. The downside: Pillow re-encoded the JPEG, so the pixel hash changed (a fresh lossy compression pass). On these synthetic test images the visual difference is negligible, but on a real photo a re-export is a generation loss — do it once, not in a loop you run repeatedly.
How much space does batch stripping actually save?
Honestly: not much, on typical photos. Our 6 test images totalled 234,007 bytes before. After the piexif strip they were 230,995 bytes (−1.29%); after the Pillow re-export 230,156 bytes (−1.65%). EXIF is tiny next to pixel data, so the space win is small here.
Two honest caveats. First, these were synthetically generated, mostly flat images — real photos with large EXIF, embedded thumbnails, or big XMP packets save more; in earlier measured runs on this site an embedded thumbnail alone cost thousands of bytes and an XMP packet reached ~33.5 KB. Second, “saving space” is rarely the reason to strip — privacy is. The GPS fix and the camera-adjacent fields are what leak your location and device, and those are exactly what batch stripping removes.
Batch stripping photos vs screenshots
The question “can I batch-strip metadata” matters for photos you shot, not for screenshots you took. A screenshot is a pixel capture saved as PNG and carries no EXIF at all, so there is nothing to batch-strip from a screenshot — a fact we measured directly in do screenshots have exif data. If you are cleaning a mixed folder of phone photos and screen grabs, the photos get stripped and the screenshots are already clean. The metadata work is all on the camera side.
How to batch-clear metadata yourself
Four ways, in order of control:
- Python loop with piexif (lossless, EXIF-only):
for p in files: piexif.remove(p). Keeps XMP and pixels intact. - Python loop with Pillow (clears EXIF + XMP, re-encodes):
for p in files: Image.open(p).save(out, "JPEG"). - ExifTool (the standard CLI):
exiftool -all= -ext jpg -r ./folderstrips every metadata tag recursively. We used piexif/Pillow in this test, not ExifTool, so we are not claiming measured ExifTool numbers — it is the widely used reference tool. - A purpose-built cleaner that runs the loop for you and previews what will be removed before it touches the file.
Pick method 1 if you must keep the pixels bit-identical (forensic or archival work); pick method 2 or 3 if you also want XMP gone and can accept a re-encode.
The honest limits of our test
So you do not over-read the result:
- We used synthetically generated JPEGs with a representative 24-field EXIF set, not photos from a specific real camera. The field / GPS / copyright / XMP behaviour is a property of the file format and the libraries, so it holds for real cameras too; the exact size-saving percentage is specific to these files.
- We tested JPEG only. PNG has no EXIF container (our screenshot work covers that), and TIFF / WebP behave differently — piexif supports all three, but we did not run those here.
- We did not measure ExifTool, only named it as the standard CLI. Our measured numbers are piexif + Pillow only.
FAQ
Can I remove EXIF from hundreds of photos at once? Yes. Metadata stripping is a per-file loop, and in our test 6 images cleared in ~0.15–0.18 seconds; a few hundred is still sub-second. Any tool that stalls on a batch is bottlenecked by something other than the stripping itself.
Does batch-stripping change my photos? With a metadata-only method (piexif.remove), no — we hashed the pixels before and after and they were identical. With a re-export method (Pillow / ExifTool re-encode), yes, slightly: the JPEG is compressed again, which is a small generation loss.
Will batch removal delete my GPS location? Yes. In our test all 6 images lost their GPS fix, along with camera make, copyright, and dates — 144 EXIF fields dropped to 0.
Is my XMP / editing history removed too? Not by a surgical EXIF strip. piexif.remove() left XMP intact on all 6 of our test images. You need a full re-export (Pillow, or ExifTool's -all=) to clear XMP as well.
Related reading
Next reads, depending on which part of this you need:
- Do screenshots have EXIF data — the main guide: the byte-level read of what a screenshot file actually contains.
- Clear metadata from photo — how to strip metadata yourself instead of trusting any tool.
- What is EXIF data — the field-by-field background on what EXIF actually stores.
- Do screenshots reveal your location — why your coordinates are not leaked through screenshot metadata.
- Can a screenshot be used as evidence — why a PNG with no self-authenticating metadata cannot prove time or device.