Home > Image Processing > 3b. Image File Formats

3b. Image File Formats

On the average, images compose over 50% of the pages on the Web.  And with cameras, mobile phones, and computers being part of our lives we have lots of pictures captured with friends or downloaded from the internet.  Either this makes us think that we are consuming much of our hard disks and memory cards, or creates the need to expand our storage to make sure our high-resolution pictures are well-kept.  Having the knowledge of image file formats helps you settle on a decision depending on how much priority you give between image quality, attribute flexibility, and memory space.

The size of an image is directly related to the number of pixels defining the image and the depth of the colors within its pixels. Different file formats have different algorithms as means of compressing these data into more compacted sizes.

Lossless compression aims to preserve the quality of the image and stores information without compromise. Data are compacted by simply searching for similar or repeated pixels around the image. Lossy compression, on the other hand, allows the storage of colors at lower resolution and considers the human limitation to detect these changes. Some file formats allow variation in quality levels, though certain extents, allows deterioration of image quality.

The most common file formats [1] are:

  • TIF – Tagged Image File Format, uncompressed and compressed formats
  • PNG – Portable Network Graphics, standardized compression
  • JPG – Joint Photographic Experts Group, compressed format
  • GIF – Graphics Interchange Format, compressed format

TIF is best when intentionally needing large images and high resolutions for banners or prints. It compresses data efficiently, either lossy or lossless, and at the same time preserves the quality of the images. TIFF however, will not be efficient as Web graphics because of its size. It is recommended to have it converted to a more portable format to be able to post it online.

PNG is efficient when smaller file sizes are needed without loss in content. Pixels are searched for patterns to be used to compress the file size. Compression is freely reversible and the image can easily be recovered. PNG supports alpha transparency (soft edges) useful for fades and anti-aliasing in texts.

Figure 1. A PNG image of a bridge upon sunset. Courtesy of Zicasso.

JPG is the default saving format for photo images. It stores information within the rich 16 million colors at minimum loss. It is usually preferred in photography to set the amount of compression needed.

GIF formats are usually used for web graphics. It supports transparent colors and is capable for multi-graphic animations. Images are compressed into an 8-bit color palette, indexing the pixels to 256 colors. Storing images may be lossy, but no further compression is done after that.

Figure 2. A. JPG image of a downtown street during the evening.  B. An animated GIF image of a rainy night.  Courtesy of MobileApples[1, 2].

Figure 3 displays a comparison between the latter three image formats [1]. Notice that JPG has slight quality issues with text.

_

PNG 26kB

_

JPG 6kB

_

GIF 12kB

Figure 3. Image quality and file size comparisons between, PNG, JPG and GIF.

The following table summarizes the important bases of comparison for image file formats and the distinguishing characteristics of each [1].

Format

Color Depth

Compression

Loss of Detail on Saves

Web

TIF variable lossless No No
PNG variable lossless No Yes
JPG 24 lossy Yes Yes
GIF 8 lossless No Yes

Greatly varied our formats may seem, the choice of file type still depends on the objective of how it is used. As always the main goal is to represent meaningful information, depending on the context.

———————————————————————————————–—————–————————————
References:
[1] CyWarp, 2000. Digital Photography: Photo File Formats. Queensland, Australia.
[2] Hewlett-Packard, 2010. Understanding digital photo file formats. United States.
[3] Mattews, G., 2010. Digital Image File Types Explained. Wake Forest University.
[4] Soriano, M., 2010. Image types and formats. Applied Physics 186.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: