How to Strip EXIF Metadata Using ImageMagick Convert?

This article provides a quick overview and step-by-step guide on how to use the ImageMagick convert command to remove EXIF metadata from your images. Digital photos often store hidden data—such as camera settings, date taken, and GPS coordinates—which can compromise your privacy or unnecessarily increase file sizes. By utilizing specific ImageMagick command-line flags, you can efficiently strip this information while keeping the core visual data intact.


Understanding the Strip Command

The primary method for removing metadata in ImageMagick is the -strip option. This option tells the program to clear all profiles and text attributes from the image file, including EXIF, IPTC, XMP, and ICC color profiles.

To remove all metadata from a single image, use the following syntax:

convert input.jpg -strip output.jpg

In this command:

Selectively Removing Metadata While Keeping Color Profiles

Sometimes, running a blanket -strip command can alter how the colors look on different screens because it deletes the color profile (ICC). If you want to strip the EXIF data but preserve the color profile for visual consistency, you can use the +profile option instead.

convert input.jpg +profile "exif,xmp,iptc" output.jpg

By specifying +profile "exif,xmp,iptc", you explicitly target and remove the privacy-sensitive metadata blocks while leaving the ICC color profile untouched.

Batch Processing Multiple Images

If you have an entire directory of images that need their EXIF data removed, you can pair the mogrify command (which belongs to the ImageMagick suite and overwrites files in place) with the strip option.

Note: Always back up your photos before running batch operations, as this tool modifies the original files directly.

mogrify -strip *.jpg

This command processes every JPEG file in the current folder, stripping out the EXIF data instantly and saving you from having to convert each file individually.