Removing Metadata From Images

Digital cameras often add a wealth of extra information to images for improved filing. However, if you value your privacy, this information can reveal details about yourself. These details may include geolocation, the kind of camera you own, your time zone, the date and time the picture was taken, and even the software you use. (In Ubuntu, right-click on an image file, and select Properties > Image to view the metadata.)

When you upload these images to the Internet, the metadata is uploaded also, so anyone can view it to piece together tidbits of information about your life and habits or even discover where you live.

Is there any way to strip this extra info?

Yes, there is, and here are two ways to do it.

Method 1. exiftool

Exiftool modifies metadata in files. There are many settings possible, but to strip everything, enter this command in a command line:

exiftool -all= *.jpg

All metadata is removed from all .jpg files. The -all= affects all metadata, and the *.jpg tells what files to modify. Exiftool duplicates the existing files but without the metadata. There is no image conversion, so the image quality remains the same. The original files are preserved by appending _original to their filenames.

Exiftool is available in the Ubuntu repositories as libimage-exiftool-perl.

sudo apt-get install libimage-exiftool-perl

Method 2. Imagemagick

Imagemagick is a fantastic command line image manipulation tool. If you are converting an image file, you can also strip its metadata in one step like this:

convert image.jpg -resize=400 -quality 70% -strip newimage.jpg

The -strip option strips the metadata. Like exiftool, Imagemagick is available from the Ubuntu repositories.
Since exiftool and convert run from the command line, they are useful in scripts that provide intelligent metadata stripping, so let your imagination discover new techniques!


  1. warmachine

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: