Remove EXIF data from images

By

Learn how to remove EXIF data like location from images on a Mac, using the ImageOptim app or the exiv2 command line tool with exiv2 rm to strip the metadata.

~~~

To remove EXIF data from an image on a Mac you have two good options: drop the image into the ImageOptim app, or use the exiv2 command line tool. Let’s see both.

What is EXIF data, and why remove it?

EXIF is metadata your camera embeds in every photo: the camera make and model, the exact date and time, the settings used, and often the GPS coordinates of where the photo was taken.

That last part is the problem. Before posting a photo on the Internet, I wanted to strip that data, because the photo was made with an iPhone and it contained my location. Anyone downloading the image could read where it was taken.

Tip: if you already know you want to remove location from a photo, in the share panel click Options before selecting “AirDrop” and you have the option to disable sending the location data, and other metadata.

The easy way: ImageOptim

The simplest way is to use ImageOptim. Just add the image in there, it will remove all the EXIF data. It also compresses the image, so it’s a nice tool to run on anything before publishing it.

The command line way: exiv2

If you prefer the command line, or you want a tool that integrates with your scripts, install exiv2:

brew install exiv2

First, use exiv2 pr to see what the image contains:

exiv2 pr venice.jpg
File name       : venice.jpg
File size       : 2482124 Bytes
MIME type       : image/jpeg
Image size      : 4032 x 3024
Camera make     : Apple
Camera model    : iPhone 13
Image timestamp : 2021:10:28 16:42:11
...

Then use exiv2 rm to remove all the metadata:

exiv2 rm venice.jpg

Run exiv2 pr venice.jpg again to verify. It now only prints the basic file properties, and reports that no Exif data is present in the file.

Watch out: exiv2 modifies the file in place

exiv2 rm strips the metadata from the original file directly. There’s no undo. If you want to keep the original photo with its data intact, make a copy first and strip that:

cp venice.jpg venice-web.jpg
exiv2 rm venice-web.jpg

Then publish venice-web.jpg and keep venice.jpg in your library.

If you don’t want to install anything, I made an EXIF viewer and stripper that runs entirely in the browser — the image never leaves your computer.

Tagged: Tools · All topics
~~~

Related posts about tools: