To provide you with additional information about how we collect and use your personal data, we've recently updated our Privacy Policy and Terms of Service. Please review these pages now, as they apply to your continued use of our website.

Messing with EXIF/IPTC metadata

I've been long searching for ways of erasing/editing file metatags (EXIF, IPTC, etc) without restrictions.

Many programs/software have ways of doing it, but most don't allow to do it freely.

I mean, they might have comercial restrictions, but when for instance adobe tools say that a tag that says the file has been edited/created in Photoshop is a not "deletable" one... they are lying.

© Digitalg ( Help)

Every metatag is editable/deletable and the image itself can be rendered without any metatag info of this type. Of course, if for instance there's no color space metatag info the pixels might be rendered somehow different than the original. But that is only a context question, the pixels are there.

How did I come to this now?

I have a new camera! Yeeeaaahhh! Yes, finally I have a modern new, and hopefully great, Pentax k-5 (I'm planning another blog entry on it when I have enought pics to ilustrate ;) ). But one downfall of it is that is embeds in image files a ton of extra info. Like at least 40Kb but usually more, much more, for each file!

If you run the file through Lightroom you can then minimize metadata when exporting, but one interesting thing I discovered is that this camera can deliver jpegs good enough to upload directly to agencies (might take some tweekening in camera settings, and some extra care when shooting, but it's possible) either by shooting jpegs directly or by processing them from RAWs in the camera!

© Digitalg ( Help)
I usually shot RAW, but this time I was in a local photo contest where jpeg was mandatory. But in the end only 6 files were to enter competition and I shot a couple of hundred others that can be used elsewhere ;)

Enough chit chat.

I came across a little tool called Exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/) completly free and can do the trick. In fact it can do pretty much any exif/iptc trick you might think of.

But it is a command line tool, not that much userfriendly, I would say userenemy enough to send many looking for other options.

But not being the first time I was looking for this I decided to read those lines and check those examples a litle more in detail.

© Digitalg ( Help)
One good thing, exiftool can be used as a drag&drop tool and it carries on doing the tasks set in the executable filename over the file you droped on it. Nice, but unfortunately you can't use all commands in a filename! And you would have to create as many executables as different tasks you'd like to do!

But fortunately you can use .bat files! Just in case you don't remember or don't know what .bat files are, they are "script" executables that can call any other executable and commands, MS-DOS like!

This way you can create as many bats as you want with as many commands as you want and keep just one exiftool executable. And you still can drag and drop files into those bat files. I'll show you some simple examples.

Now, what do I need to erase/change in EXIF info?

If I want to completetly strip all EXIF info from files I would execute: exiftool -all= jpeg_file.jpg

or create a bat file with this single line:

exiftool -all= %1

%1 takes the name of the file you drop on the bat file, or the first argument you pass to the bat file if calling it from command line.

I usually don't want to do that, but this is to ilustrate my first lines. And I was able to reduce filesize by some 50Kb to 100Kb.

© Digitalg ( Help)

The main syntax to use exiftool is: exiftool -:=

To delete a field keep the value blank after the equal sign.

What I do want to do is:

- remove manufacturer notes

- remove printing information

- remove thumbnail binary code

- set colorspace (my camera is set to Adobe RGB but EXIF keeps saying "uncalibrated" and after removing manufaturer notes there's no other source for that info)

- set image orientation to 0

© Digitalg ( Help)

To remove manufacturer notes: the EXIF group name for manufacturer notes in my camera is MakerNotes (might be different for other brands), the parameters are: -MakerNotes:all=

For printing information: -PrintIM:all=

For thumbnail binary info: -Composite:ThumbnailImage=

To set color space do Adobe RGB: -Exif:ColorSpace=A (this took some guessing! those values are not always obvious neither are their meanings)

To set image orientation to 0

If you don't know the Group Names you can use exiftool to list them with this command: exiftool -groupnames

© Digitalg ( Help)

The orientation thing explanation:

Image bytes are always created/saved as horizontal and then EXIF can add the info about camera orientation so that software can know how to rotate the pixel to show the way the picture was made.

But if software, specially older software, is not aware of it, will always use the image bytes orientation. I use a 1998 version of ACDSee for fast view!!

You can do a lossless rotation of the image, older software will show it ok, but EXIF info is still there and newer software will be wrong this time!

Same can happen with sites that don't read all EXIF info so you might endup uploading a wrongly oriented image!

So I set rotation to 0

I now have two bat files:

cleanexif.bat

exiftool -MakerNotes:all= -PrintIM:all= -Composite:ThumbnailImage= -Exif:Orientation=h %1

adobeRGB.bat

exiftool -Exif:ColorSpace=A %1

There, hope this helps you...

Photo credits: Armando Frazão.

Your article must be written in English

Publish
January 20, 2012

Markbfowler

DF/Tools has a utility that allows deleting any metadata item from exif in digital images. You have to fuss with an XML file to change the attributes on some of the exif properties to allow for deletion, but it works on those properties from then forward. I think it is set up for "safety", but you can modify it to hack away at the metadata pretty much however you want. I love it for the keyword editing.http://dftools.fwlr.com/

June 26, 2011

smartview27

Thanks for sharing!

June 24, 2011

Digitalg

"Messing" in the title was not a light choice ;)
I know many won't bother leaving all metadata embeded in files. But, besides the slight increase in file size, I really don't like to leave info that is not needed. I specially don't like to leave tags that say which software I've used for this or that. And then, who needs info into such details as how many seconds did I press the shutter release button before taking the shot?
That is the kind of info that I don't see what use might have in an agency collection. It gets to be (almost) personal info up to some point.
And yes, I'm also a bit low level minded and I like to understand things down to the root.
I've seen before plenty of requests for how to erase unuseful (or for anyother reason) metadata that, having found a way, I thought of sharing it.

June 24, 2011

EmeraldUmbrellaStudio

I have always just done all my meta work in Bridge and have never had a rotation issue

June 24, 2011

Digitalg

I've just seen that some syntax lines were trimed by HTML parsing and now I can no longer edit it. Here it goes:
Main syntax is:
exiftool -<group name>:<field name>=<value to assign> <filename>
cheers

Related image searches
EXIF related image searches