MacDevCenter    
 Published on MacDevCenter (http://www.macdevcenter.com/)
 See this if you're having trouble printing code examples


Use Metadata to Improve Your Pictures

by Derrick Story, author of Digital Photography Pocket Guide
11/14/2002

Every time you click the shutter, your digital camera records valuable picture data that describes the image you just captured. Data such as time, shutter speed, aperture, focal length, and ISO are written to the file header in the EXIF format (Exchangeable Image File). This information becomes part of the total image file and can be displayed with applications such as Photoshop 7 and iPhoto 1.1.

In essence, each picture file contains a complete photographic history of the decisive moment that can be analyzed to help you understand why the image was successful, or give you clues as to what went wrong. In this article I'll show you how to retrieve this data and use it to hone your photography skills.

What is EXIF?

The EXIF format is an international specification first established in 1995 that enables digital cameras (and other imaging devices) to write data to the file header of the image. EXIF files use the JPEG DCT format specified in ISO/IEC 10918-1. The picture portion of the file can be read by any application supporting JPEG including Web browsers and image editors. The metadata can be accessed by applications designed to extract that information out of the header and display it. The most common imaging applications for Mac OS X have no problem displaying at least some of the EXIF data: iPhoto 1.1, Photoshop 7, and Graphic Converter 4.5.

However, the picture file usually contains more information than what's typically displayed by a given application, unless that app is specifically designed to output EXIF information. For example, iPhoto provides the basic time, date, file size, and camera information when you click on the Photo tab of the Show Info window. If you click on the Exposure tab you get more data such as shutter speed, aperture, focal length, exposure compensation, metering pattern, and flash status.

Screen shot.
iPhoto will display metadata for any picture in your library. Simply select the picture and choose "Show info" from the File Menu.

But iPhoto doesn't provide you with other goodies sitting there in the file header, such as ISO speed and white balance. If you need that information, you'd have to open the file with another application designed to grab that data. The point is that the EXIF specification dictates what goes in to the picture file, but image editors typically only give you a portion of that information. So if you get serious about reading this stuff, you might need to add a couple tools to your imaging bag of tricks. More on this later.

Why Would You Want to Read EXIF Data?

When you take pictures, some turn out better than others. Why is that? Beyond good composition and subject matter, there are many factors that we know contribute to powerful images. These include time of day, depth of field, proper shutter speed, and exposure compensation as needed.

If you look at a picture of running water, for example, and you like the way its rendered, wouldn't it be nice to know the settings that you used so you could duplicate the effect again? Before digital cameras were available, I would take handwritten notes to help me remember the settings for particular shots. I hated that. Now the camera records all that information for me, and I'm free to concentrate on taking good pictures.

Photo of running water.
According to the metadata displayed in iPhoto, this picture was captured at 1/50 at f-2.5. Notice that the water shows a little motion, but for the most part is "frozen" in what we call "stop action."


Photo of running water.
On the other hand, in this picture the water has a painterly effect and is very soft. iPhoto says that the shutter speed was 1 sec at f-8.

After studying figures 2 and 3, I know that I can control the way water appears by adjusting the shutter speed. The 1/50 of a second exposure stopped the action to some degree, and the 1 sec. exposure created a very soft look. Now the next time I shoot running water, I can capture the exact effect I want by adjusting the shutter speed.

Time of day also has a dramatic impact on pictures. (Make sure you have your camera's time and date settings correct so they are accurately recorded with the picture.) Over the course of a few hours, a scene can totally change in appearance. Take a look at the two following images.

Photo of lake.
When I checked the metadata for this picture in iPhoto, it said that the image was captured at 10:45 a.m.


Photo of lake -- a while later.
This shot from roughly the same location was captured at 8:15 a.m. the following day. The scene is rendered much differently than the picture shot two-and-a-half hours later the previous day.

Even though these pictures were captured from approximately the same location only a day apart, they are much different. The sun was higher in the first picture, and it flattened out the scene, rendering more even highlights and shadows. The same picture shot two and a half hours earlier the next day shows the difference when the sun is lower and creates harsher highlights and shadow areas.

Digital Photography Pocket Guide

Related Reading

Digital Photography Pocket Guide
By Derrick Story

If I were to go back to these lakes at the same time next year, then I could determine what time to start shooting based on my review of the metadata for the pictures above. If I wanted flat, less dramatic lighting, then late morning seems ideal for that effect. On the other hand, if I like the harsher contrast of darks and lights, then I know I have to get there a few hours earlier.

These are just a couple ways to review EXIF data to analyze your pictures. Other settings such as flash on or off, exposure compensation, white balance, and aperture setting (for depth of field) are all important clues to understanding the success or failure of your images.

What Should You Use to View EXIF Data?

You have many options for viewing the EXIF data your camera captures. As I mentioned before, iPhoto provides you with most of the important information that you commonly would need. Also, take a look at the software bundled with your camera. For example, both Nikon and Canon provide image utilities that are compatible with Mac OS X, and they are pretty good at giving you the data your camera captures.

Since I shoot many of my pictures with Canon cameras, I use their bundled Image Browser when I want to access all the important metadata accompanying my pictures. Here's a sample of the EXIF output I get from Canon's Image Browser application:

Dig deeper into digital photography! In addition to reading the O'Reilly Digital Photography Pocket Guide by Derrick Story, you can also learn more helpful techniques like these by attending his all day workshop at the San Francisco Graphic Art Institute on Nov. 22, 2002. More cities are being scheduled.


Related Articles:

Top Ten Digital Photography Tips -- You have a digital camera and have taken the typical shots of family and friends. Now what? Here are ten tips to make your next batch of digital images so impressive that people will ask: "Hey, what type of camera do you have?" Guess what? It's not the camera.

Top Ten iPhoto Tips -- Yes, at first glance, iPhoto appears deceptively simple. But there's a Unix-compatible database lurking beneath that beautiful Aqua surface. This article gives you five "data in" and five "data out" tips that will help you get the most from this very cool iApp.

Metadata from Canon Image Browser Application

This application shows me settings such as white balance that aren't displayed in most image editors. I don't always need this level of detail, but it's nice to know it's there if I want it.

Photoshop 7 does a pretty good job of reading and displaying metadata too. Just go to File -> File Info, then select EXIF from the dropdown menu in the dialog box. It's the last one at the bottom of the menu. Photoshop doesn't provide everything, but it does give you lots to chew on.

Image data from Photoshop.
Photoshop 7 provides lots of image data. Some of it you probably won't need.

Another handy tool that I keep on my Dock for quick and dirty data checking is EXIF Viewer for Mac OS X by Ali Ozer. This free download provides you with most of the data you need plus displays a thumbnail image to boot. I simply drop the file on the application icon on my Dock, and the information is quickly displayed.

The only bug that I've discovered so far is that sometimes the viewer incorrectly displays the flash information. For my Canon images it says that the flash was on when indeed it wasn't. But other than that, this nifty app is a reliable time saver.

Screen shot.
EXIF Viewer for Mac OS X is a great addition to any photographer's Dock. Just drop the image on the app icon, and you're presented with a thumbnail image and lots of data.

Final Thoughts

I recommend that you keep a set of original files for all of your important images. In part, I think this is just good file management. But I also like to have those original pictures because I know that the metadata will be intact for me to review whenever I want.

When we manipulate pictures and save them in optimized formats, important metadata is sometimes removed from the header. If you don't have those original files to fall back on, you might lose that information forever. Plus, it's always wise to have the unaltered, uncropped picture stashed away safe and sound.

We're just scratching the surface of picture metadata. Soon GPS-equipped cameras might be able to record positioning coordinates to the EXIF file, that could later be translated into locations when browsed with the image editor. Who knows what else? But for now, tapping EXIF data can certainly help us take better pictures and serve as a permanent record for when we recorded them.

Derrick Story is the author of The Photoshop CS4 Companion for Photographers, The Digital Photography Companion, and Digital Photography Hacks, and coauthor of iPhoto: The Missing Manual, with David Pogue. You can follow him on Twitter or visit www.thedigitalstory.com.


Return to the Mac DevCenter.


Copyright © 2009 O'Reilly Media, Inc.