Links

Did You Know?

 

Digital Picture Basics Lesson 4 - Digital Image Formats

Digital images come in many different formats and it's important to be able to distinguish between them and to know when to use each type. Most digital images can be sorted into two categories.

Lossy Vs. Lossless

If a format is Lossless, this means that it preserves all colour information. Every hue and every shade in every pixel. Lossless formats can represent up to 16 million different colours. The result is better image quality and larger file sizes.

If a format is lossy, that colours in the image that are similar are converted into one common colour or eliminating unused colours all together. Lossy formats can use as few as 2 colours (black and white) and as many as 256 colours. The result is lower quality, but smaller, more manageable file sizes.

 

lossless
lossy

PNG Format - Lossless

156 K

GIF Format - Lossy

23 K

 

When to Use Lossy

When working with images that will be displayed on the web or sent via email, it is essential to use a lossy format with smaller file sizes. This way, images are transfered more easily and pages will have much shorter loading times.

When to Use Lossless

When you are working with images that are meant to be printed or displayed electronically, the best quality if of the utmost importance. In this case, we should use a lossless format because file size is not important, as the files are not being transfered.

Image File Formats

TIFF

TIFF is, in principle, a very flexible format that can be lossless or lossy (you can choose when you are saving the file). The most common use for TIFF, however, is as a lossless image storage format that uses no compression at all. Because most TIFF images are not compressed file sizes tend to be very large.

PNG

PNG is also a lossless storage format. However, instead of maintaining the file with no compression, it looks for patterns in the image that it can use to compress file size. The compression is exactly reversible, so when the image opened, it is recovered exactly.

GIF

GIF creates a table of up to 256 colors from a pool of 16 million. If the image has fewer than 256 colors, GIF can render the image exactly without compressing it (so technically it would be lossless). When the image contains more than 256 colors, GIF will compress the image by using the approximate the colors in the image with the limited palette of 256 colors available. Image software that can create GIF images will search the image for the best 256 colours (choosing from the 16 million available) to use for that particular image.

GIF achieves compression in two ways. First, it reduces the number of colors of color-rich images, thereby reducing the number of bits needed per pixel. Second, it replaces commonly occurring patterns (especially large areas of uniform color) with a short abbreviation: instead of storing "white, white, white, white, white," it stores "5 white."

JPG

JPG is a lossy format that is optimized for photographs and similar continuous tone images that contain many, many colors. It can achieve astounding compression ratios even while maintaining very high image quality. JPG works by analyzing images and discarding kinds of information that the eye is least likely to notice. It stores information as 24 bit color.

The degree of compression of JPG is adjustable. At moderate compression levels of photographic images, it is very difficult for the eye to discern any difference from the original, even at extreme magnification. The trick for JPG is to choose a compression that represents a balance between quality and file size.

**** Note ****

Most digital cameras capture photos and store them as JPG files. This the most common format for photo files when dowloaded from a camera.

RAW

RAW is a lossless image output option available on some digital cameras. These images are very big and may not be manageable if you are working with hundreds of images per week that need to be stored. Another disadvantage is that there is a different RAW format for each manufacturer, and so you may have to use the manufacturer's software to view the images.

**** Note ****

Some cameras have the ability to capture images in RAW format instead of JPG. Usually this is not the default though, so you would have to change your camera settings.

BMP

BMP is an uncompressed proprietary format invented by Microsoft. There is really no reason to ever use this format.

PSD

PSD is a proprietary format that belongs to Photoshop. When a file is stored as a PSD, it is a working format. This means you can edit images in the software, because only the proprietary formats retain all the editing power of the programs. These packages use layers, for example, to build complex images, and layer information may be lost in the nonproprietary formats such as TIFF and JPG. However, be sure to save your end result as a standard TIFF or JPG, or you may not be able to view it in a few years when your software has changed.

Compatibility

Currently, GIF and JPG are the formats used for nearly all web images. PNG is supported by most of the latest generation browsers. TIFF and PSD are not supported by web browsers, and should be avoided for web use. PNG does everything GIF does, and better, so expect to see PNG replace GIF in the future. PNG will not replace JPG, since JPG is capable of much greater compression of photographic images, even when set for quite minimal loss of quality.