Updated: May 19, 2021
Images be images. Photos be photos. A collection of pixels. But not just. Various image formats also support the inclusion of additional information in the image file, things like resolution, focal length, shutter speed, GPS data, and more. This extra stuff, commonly referred to as Exif data, can be useful for tagging and search, but it may not necessarily be the best thing when it comes to privacy.
In this article, I'd like to show you a few useful methods for how to examine and then optionally remove Exif data from your photos or images, so that if you must share them with other people, they don't contain too much unnecessary information other than pretty pixels. I'll mostly focus on Linux, with some small extras for Windows folks. All right, follow me.
Typically, the Windows desktop has an upper hand in the desktop arena, but when it comes to specific, dedicated tasks, Linux outshines the competition. In this case, too, you will find a superior set of purpose-built utilities for viewing and deleting Exif data from photos available in most distro repos.
The tools you want to consider are: exif, iptc, and exiv2. The last one is a Jack o' all Trades, because it can handle multiple metadata types - Exif, IPTC, XMP, as well as image comments.
To view metadata with exif, just run it against a photo (say a JPG file).
exif "image file"
Then, to delete the data, run the tool with the --remove flag. This will delete the embedded metadata and create a backup file.
exif --remove Photo.JPG
Wrote file 'Photo.JPG.modified.jpeg'.
If there's no metadata, the tool will exit with an error:
The data provided does not follow the specification.
ExifLoader: The data supplied does not seem to contain EXIF data.
Exiv2 also allows you to view and delete data. Specifically, for our task at hand:
exiv2 rm Photo.JPG
Windows side ...
In Windows, you can right click on any file and check its details, including metadata. Now, to delete the data, I will call upon my favorite image viewer, IrfanView. This tiny, handy application does it all. As it happens, it can also take care of your metadata. There are two ways you can accomplish this:
- Open an image/photo. Copy it. Delete the canvas (with D). Paste the image, and then save it. The metadata will be gone.
- Choose the Save action from the menu. You will be prompted with a dialog window, including save options. For instance, for JPG files, you have the option to choose the save quality, progressive and chroma settings, and whether to retain the original Exif, IPTC, XMP, and comments. You can untick the boxes, and the file will be saved without the metadata.
There you go. Exif data purged, and all your base are belong to you. Now, overall, metadata isn't evil per se, especially if you have large collections of photos, and you like to have them tagged and organized and whatnot. But sometimes, you may not want to show everything about your images to random people. Hint: you upload your photos online, to galleries, social media, or sharing sites. Cough cough.
If you want to exercise control over your photos, and you don't mind using Linux, then you have a plethora of tools at your disposal. In Windows, you will usually need to install some software you like or trust. For me, IrfanView does the job. It also comes as a portable application, so it can be part of your take-anywhere toolbox. Well, I hope this was useful. And we're done.