When sending images or exporting them from your post-processing software, you might be including sensitive EXIF data that contains such information as your camera, lens, exposure settings and even potentially your GPS location inside those images. That’s because most cameras today automatically embed this information to images. In this article, we will go through the process of removing EXIF data from your photographs using different tools.
1. EXIF Data and XMP Data Explained
There are multiple reasons why you might want to remove EXIF fully or partially from files:
- To post images to a low-bandwidth site and keep their sizes small
- To protect your work and hide information that reveals your camera gear, settings and even post-processing adjustments
- To remove sensitive data such as your personal information and GPS location
- To remove unnecessary junk from JPEG files to keep them smaller, yet retain important EXIF data such as shutter speed, aperture and ISO.
I personally use the last reason to keep my files a little smaller and to make sure that unnecessary junk does not get written into my JPEG files. However, in many cases, you might want to remove sensitive data such as your personal information and GPS location from every image you are planning to send or upload on the web.
Let me first explain what EXIF data is written into a file. If you use Adobe products such as Photoshop or Lightroom for manipulating your images, EXIF Data typically consists of three parts: normal EXIF data that contains your camera settings, XMP Data that contains post-processing steps you took before the image was exported and a thumbnail of the image. Here is a short excerpt from the Wikipedia article:
XMP also defines particular schemas for basic properties useful for recording the history of a resource as it passes through multiple processing steps, from being photographed, scanned, or authored as text, through photo editing steps (such as cropping or color adjustment), to assembly into a final image. XMP allows each software program or device along the way to add its own information to a digital resource, which can then be retained in the final digital file.
Is this good or bad? Having XMP in your original image files is definitely good, since it retains your settings in case your post-processing software. However, why would you want to keep all of it in exported images?
Let’s look at a sample image that contains XMP Data:
I opened an image using an ASCII text editor and look at what’s in that file – that’s in addition to the EXIF data that is already stored in the file header. Scrolling down, I could see everything from White Balance to Saturation and Hue adjustments I used in Lightroom before exporting the image. Worst of all, the file even included ALL of the image history, including what I did in Photoshop and how many times the image was saved!
Take a look at the yellow area highlighted in this screenshot:
I applied Tone Curve to my image and as you can see, the history is right there. Imagine how large your files can grow if you work on them multiple times! In addition, why would you want to preserve the thumbnail of the image (saved inside the image) that is being exported for the web?
2. Removing Unnecessary EXIF and XMP Data
Let’s now talk about how you can either completely or partially remove both EXIF and XMP Data from an image. There are multiple ways to remove EXIF and XMP data from JPEG files – you can either remove EXIF data completely, or you can choose what to keep, while deleting specifically what you want.
2.1. How to Completely Remove EXIF Data
The easiest way to remove EXIF and XMP Data from an image without involving third party software is to either do it in Photoshop or in Lightroom. In Photoshop, simply go to File->Save for Web & Devices and make sure that “Metadata” is set to “None”:
Once you save the file, all EXIF and XMP Data will be gone!
You can achieve a similar result in Lightroom by selecting “Copyright Only” from the “Include” drop-down field under “Metadata” section, which will remove most of the EXIF data except your copyright information from the image:
However, this only does what it says – it does not completely remove all the metadata. While things like your camera information, exposure settings and XMP data will be gone, your copyright information along with an embedded image thumbnail will be preserved. Unfortunately, Lightroom does not give an option to strip all the metadata from files, so you will need to use other tools to do it.
While there are some websites that allow one to upload images and strip metadata from them, I personally use Phil Harvey’s “ExifTool” to do the job, because it is fast and I can process many images at once. Download the executable file, then use the following command prompt:
exiftool -all= SourceFile.jpg
Obviously, replace SourceFile.jpg with the name of the JPEG file you want EXIF data deleted from. As a result, all metadata, including the image thumbnail will be stripped from the file. If you want to remove EXIF data from all images in the same folder, specify “*” (without quotes) instead of the file name and it will go through every image.
2.2) How to Selectively Remove EXIF Data
This part is for those like me, who like to keep important EXIF data in their images, but want to get rid of all other junk such as XMP Data and image thumbnails from their images. There are two ways to do this – from Lightroom directly, or from a command prompt. I personally like to do it directly from Lightroom, because it saves me a lot of time. If you already have a bunch of exported files, it might be easier to just run the tool from the command prompt.
First, download ExifTool, if you haven’t done it already. Create a folder called “ExifTool” on your root folder and put the executable “exiftool(-k).exe” into that folder. On my Windows 10 system, the full path to the executable file is “C:\ExifTool\exiftool(-k).exe”. You can save it elsewhere, if you want to – that’s totally your choice. Then, go ahead and create a text file in notepad and copy-paste the following into it:
“C:\ExifTool\exiftool(-k).exe” -overwrite_original ^
Now save the file as “RemoveJunkEXIF.bat” in the same folder where you saved the exiftool executable. You should now have two files in that folder. So, what does the above batch file do? It basically calls exiftool, removes all XMP Data, IPTC Keywords and image thumbnail from your file, while keeping the rest of the EXIF data intact. The option “-overwrite_original” makes the tool overwrite the file, rather than creating a separate file and renaming the original.
Once you save the file, go to Lightroom and open the export dialog box. On the very bottom of the page, expand “Post-Processing”, then select “Open in Other Application…” from the “After Export” drop-down. Then click on “Choose…” button, browse to “C:\ExifTool” folder and double click on RemoveJunkEXIF.bat file. The export screen should look like this:
Now click “Export” and make sure that you are not getting any errors. If the export succeeded and you did not receive any errors, you are all set! Next time when you export your images, this setting will be preserved and your EXIF data will be correctly removed from your files!
If you have a bunch of image files that you need to remove EXIF data from, then I recommend executing exiftool directly from a command prompt. Just copy all your image files to the “C:\ExifTool” directory, then open up command prompt and do the following:
Obviously, if you are on a different platform or placed exiftool in a different folder, just change the folder path above and everything should work perfectly!