11
\$\begingroup\$

Whenever I share my photographs, I also share lots of information that I do not want to pass on:

  • specific camera model that the photo was taken with
  • exposure time
  • focal ratio
  • ...

How can I remove all those metadata for sharing?

I'm particularly looking for solutions for Max OS X.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ Basically the answers to What's a good batch-mode EXIF data editor? apply. I use jhead, which can do coarse-grained removal of all metadata and which works on many operating systems. \$\endgroup\$
    – mattdm
    Commented Apr 21, 2012 at 11:37
  • \$\begingroup\$ (While technically a duplicate, this is still a good question since it's such an important concern.) \$\endgroup\$
    – mattdm
    Commented Apr 21, 2012 at 11:42
  • 1
    \$\begingroup\$ @mattdm - duplicates can be good as they provide a different route to the answer \$\endgroup\$
    – ChrisF
    Commented Apr 21, 2012 at 11:56
  • \$\begingroup\$ @mattdm Thanks for the link! I did not know that such metadata is stored as EXIF files. Both of those tools are command line based which I do not prefer, but can accept. How can I use jhead to remove all metadata at once? \$\endgroup\$
    – user9426
    Commented Apr 21, 2012 at 11:59
  • 1
    \$\begingroup\$ jhead -purejpg will delete all metadata, by the way. \$\endgroup\$
    – mattdm
    Commented Apr 21, 2012 at 12:16

7 Answers 7

6
\$\begingroup\$

nconvert is a fantastic tool to convert and manipulate images. It is available for a huge number of platforms in cluding Mac OS X and some plaforms I thought were long gone :)

To wipe all metadata you have to use the rmeta option, as in:

nconvert -rmeta DSCN0001.JPG

There is a small catch with all such operations depending on your camera. When you take photos in portrait orientation (the long side being vertical), some cameras create a JPEG with the rotated dimensions and others simply flag the jpeg as being rotated. In the latter case, removing all metadata will make all images appear in landscape orientation. nconvert provides an easy fix for this:

nconvert -jpegtrans exif DSCN0001.JPG

...which you have to do before removing the metadata but you can combine into one operation as in:

nconvert -jpegtrans exif -rmeta DSCN0001.JPG

PS: If you use Lightroom to export your images before publication and enable the option Minimize embdeded metadata, your images will be correctly oriented and stripped of metadata except for copyright information which is something you may want to keep embedded anyways.

\$\endgroup\$
4
  • \$\begingroup\$ Thanks, this is awesome! I'm just worried about why first command resulted in the image size dropping from 5.6 MB to 868 KB. \$\endgroup\$
    – user9426
    Commented Apr 21, 2012 at 13:32
  • 1
    \$\begingroup\$ That's a whole lot of metadata! :) There is an optional quality argument which you can specify as a value between 0 and 100. 100 is the best. 90 is good and 85 is reasonable but I do not go any lower. Just specify it as -q 95 for example. Try it with 100 too. \$\endgroup\$
    – Itai
    Commented Apr 21, 2012 at 18:16
  • 1
    \$\begingroup\$ If it's going from that big to that small, something more than metadata must be lost. The default must be to recompress. \$\endgroup\$
    – mattdm
    Commented Apr 21, 2012 at 19:52
  • \$\begingroup\$ Indeed, it is surprising. My version has the default to 100 (as specified in the docs) but maybe the Mac version is different (I'm on Linux). \$\endgroup\$
    – Itai
    Commented Apr 21, 2012 at 23:49
8
\$\begingroup\$

Imagemagick supports Unix, Mac OS X, Windows...

You can delete EXIF info using mogrify:

magick mogrify -strip *.jpg
\$\endgroup\$
1
  • \$\begingroup\$ Also, if you resize with --thumb (even if the target size is larger than a normal "thumbnail") it will strip metadata as well. Handy for web use. \$\endgroup\$
    – mattdm
    Commented Apr 21, 2012 at 18:57
2
\$\begingroup\$

PNG files don't contain EXIF data so if you save as PNG first and then as JPEG that will remove all EXIF information with zero impact on image quality as PNG files use lossless compression. The advantage to this is that it can be done with almost any image editor on any platform.

PNG files have their own metadata fields so it would theoretically be possible for an image editor to extract the EXIF information and insert it into custom fields within the PNG but I've never seen one that did.

\$\endgroup\$
2
\$\begingroup\$

Another command-line tool that can do this is exiftool, using the option -all=. Here's an example:

exiftool -all= image.jpg

You can wildcard all files in a directory using the normal Unix-style shell globbing:

exiftool -all= *.jpg
\$\endgroup\$
2
\$\begingroup\$

Almost a decade late with this answer, but Photoshop's 'Export as…' [the replacement for 'Save for Web'] deletes almost all metadata with little option to keep it; only copyright & contact details remain, if selected.

enter image description here

In fact, to preserve metadata, you must use the Save for Web (Legacy) function, which still exists as of Ps 2020.

enter image description here

The key commands may be my own, not defaults.

\$\endgroup\$
1
\$\begingroup\$

For Windows, there's a free command-line utility called PureJPEG that can be used to remove all information from a JPEG file (or a directory and its subdirectories full of files) not necessary for displaying the image. It's a one-trick pony, but its one trick appears to be exactly the one you want to see.

\$\endgroup\$
1
  • \$\begingroup\$ I use PureJPEG, too. That's not a Mac solution, though. \$\endgroup\$
    – Eric
    Commented Apr 21, 2012 at 13:32
0
\$\begingroup\$

I just found a program that has an actual gui and works great. You just drag images onto it and it deletes all the data.

http://codewelt.com/stripper

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.