Resources - Geek Speak - Digital Image Files



Digital Image Files:
To Compress or not to Compress?

So you have started to capture images of your collection for use in publicity, for an internet-based project, or for your collection database. What is the best way to store these images? While it is true that what you want to do with the images influences your choices, there are some standard approaches that can be followed to ensure that the images you capture are of most use – regardless of application.

If your institution has the resources, having a professional shoot transparencies of your collection and then scanning them is the best way to go. This will give you the flexibility to use the same image for a poster, or on the web, or to license and loan out that image for publication. This approach is, however, extremely time consuming and very expensive.

For most cultural institutions, digitization is undertaken with a digital camera on a project-by-project basis or incrementally as items are accessioned; the resources for long-term capturing projects are non-existent.

When committing images to file it is important to understand a little about the format the image is stored in. Most digital cameras store images in the JPEG format, and this is also the de-facto image format for the internet. JPEG (which stands for Joint Photographic Experts Group) is a pretty good image format: it can store 24 bits of information per pixel – up to 16 million colours; it is a widely adopted standard that can be opened by virtually any image-editing application; additional photo info such as camera settings and date can be stored in the JPEG file itself (EXIF); and the image files are compressed to take up less space in storage.

This last point is both JPEG’s biggest strength and greatest weakness, particularly in the visually-exacting cultural sector. There are essentially 2 kinds of compression: lossless and lossy. The former takes every piece of information in a file and compresses it, so that, when the file is later decompressed and opened, all of that information is still intact. ZIP files are a good example of lossless compression.

JPEGs use lossy compression. They use an algorithm that compresses the file, but discards image information that is apparently redundant or unnecessary. This allows for excellent compression, but can also introduce the dread JPEG mottle: blurry patches in an image where the picture appears to have been smeared. Thankfully the JPEG standard allows for user-defined degrees of compression. In Photoshop, this is a “JPEG quality” slider that goes from 1 to 12 (in older versions of Photoshop, 1 to 10).

This is the most important part of this article: when working with JPEGS, ALWAYS save them at the highest quality! As well, when a JPEG file is opened, edited, and re-saved, the JPEG algorithm is re-applied to it. That is, the more an image is edited and saved, the more image information is discarded, the worse it will look. Always saving at the highest quality setting will mediate this somewhat, but the best solution is simply to shoot the images as close to perfect as possible to begin with and, if editing is necessary, make all the edits in one go.

So why not just use lossless image formats? Well, despite the gloomy picture painted above, JPEGs are actually very good. A best quality JPEG is indistinguishable from a TIFF, and the saving in file space cannot be overstated. A 6 megapixel JPEG will generally weigh in at about 2 megabytes; the same image, saved as a TIFF with LZW compression will be about 17 megabytes.

Finally, most digital cameras capture images as JPEG natively, so the algorithm has already been applied and switching the format after the fact will not improve the image quality.

Jonathan Lathigee (jonathan@zeroonedesign.com) is a geek, a partner in Victoria-based internet development company Zero One Design Inc. (www.zeroonedesign.com), and the I.T. Administrator at the Art Gallery of Greater Victoria (aggv.bc.ca)




Zero One Design
Copyright © 1997-2007 by zero one design inc.