Three-Minute Tech: Image file formats
[In our Three-Minute Tech series, we tell you everything you really need to know about a new technology in three minutes or less.]
JPEG, GIF, TIFF, and PNG...what does it all mean? Thanks to improving smartphone cameras, hot new photography apps, and cheaper, higher-quality digital cameras, we're all taking far more pictures than ever before. We're editing them, tweaking them, and sharing them. And as part of that process, we're saving them. When you look at that big list of image formats in the save menu of your favorite photo editing program, which should you pick?
There are almost more formats than stars in the sky, and most of them you can safely ignore. Here's a list of some of the most common ones, and their defining traits. Hopefully this will help you decide what format is best for your digital artwork.
Before we begin, you should understand the difference betweeen lossy and lossless. A lossy compressed image will look different from the original, sometimes in very minor ways that you can't even see without a trained eye. It helps produce smaller files (that is, better compression) if you're willing to suffer a greater loss of image quality. Lossless file types produce images that are, pixel for pixel, the same as the source image, and are generally much larger files.
Perhaps the most common digital file format, this carries the file extension .jpg or .jpeg. The acronym stands for Joint Photographic Experts Group, the committee that agreed on the standard. Nearly every digital camera and graphics application can save to JPEG format. It's supported on scores of devices and can compress files to a very small size, but it's pretty lossy (especially if you go for very small file sizes) and doesn't support more than 8 bits of color for red, green, and blue. It also doesn't support transparencies. It's not a bad choice for casual photos, just don't use heavy compression.
Pronounced "jif" (like the peanut butter), the old Graphics Interchange Format dates back to CompuServe circa 1987. It allows for only 256 colors in the whole image; a severe limitation. This makes it terrible for most photos, but there is one big advantage: animation. Multiple frames can be stored together with time delay information, producing a flip-book effect. Animated GIFs have taken on a new life on social networks as a way to show amusing animations without embedding video files. GIF images also support transparent pixels, which can be useful in web design.
If you deal with phography, you'll hear people talk about RAW images a lot. RAW is not actually a single image format. Rather, it's a term that means "the unprocessed data from your camera's image sensor." Different brands and models of camera use different file formats for RAW images, and they require specific codecs to be supported by applications. RAW files tend to take up a lot of space, and aren't good for distributing or posting online. The intent is to get un-processed data from your camera into your photo editing software, where you'll process and edit before saving in another format.
Most bitmap images carry the file extension .bmp. They can be almost any size, in color or black and white, and can even support more levels of color than formats like JPEG or PNG. They can even optionally include transparency and color profile information. Still, you don't see them that often. Why? Because most bitmaps are uncompressed, which makes for enormous files. Even when they are compressed, the compression ratio isn't very great, so the files are still quite large. Thus, bitmaps are an unpopular tradeoff between file size and quality.
The Portable Network Graphics format was initially created to replace GIF, which was saddled with CompuServe patents, though it improves upon GIF in many ways. Like JPEG, it supports 8 bits of color in red, green, and blue, but adds support for 8 bits of alpha (transparency) data. PNGs are compressed, but the format uses an efficient lossless compression scheme—the same compression used in .zip files—which keeps file sizes down. Gone is the animation support from GIF, but the vastly improved color reproduction, 256 levels of transparency, and lossless compression have made PNG quite popular. It's a good choice over JPG for images with lots of fine text or soft gradients, which often produce artifacts in the lossy compression format of JPG.
Officially "Truevision TGA" but usually simply called TARGA, this file format still lives on in a few circles, carrying the extension .tga. It originates with the the first add-in graphics cards for PCs to support 16-bit and 24-bit color. Like PNG, it supports up to 8 bits of precision for red, green, blue, and alpha (transparency). TARGA files can be uncompressed and quite huge, or use lossless compression. The format's support for alpha or key channels, gamma values, and other metadata makes it somewhat useful in animation and video production. You rarely see it elsewhere.
The Tagged Image File Format has been popular in the print publishing business for a long time - it was developed by Aldus systems (which was bought by Adobe) specifically for use in desktop publishing. TIFF files usually have the .tif or .tiff extension. It's a very flexible format, and can contain information useful in publishing, like clipping paths. TIFF can be uncompressed or use lossless compression, or even serve as a "container format" for lossy compressed images like JPEG. TIFF images can be of extremely high resolution to support high-DPI print layouts. Outside of the publishing business, you don't see TIFF used very often.