Image file format

This is an old revision of this page, as edited by 86.140.111.79 (talk) at 15:40, 27 October 2005 (TIFF). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Introduction

Image file formats provide a standardized method of organizing and storing image data. This article deals with digital image formats used to store photographic and other image information. Image files are made up of picture elements, called pixels. The pixels that comprise an image are in the form of a grid of columns and rows. Each of the pixels in an image store digital number representing brightness and color.

Image file sizes, expressed in bytes, increase with the number of pixels in the image, and the color depth of the pixels. The more rows and columns, the greater the image resolution and the greater the file size. Also, each pixel making up the image increases in size as color depth is increased. An 8-bit pixel (1 byte) can store 256 colors and a 24-bit pixel (3 bytes) can store 16 million colors. The latter is known as true color. Image compression is used to decrease file sizes, and this will be discussed later.

High resolution cameras lead to large image files. Files sizes may range from hundreds of kilobytes to many megabytes depending on the cameras resolution and the format used to save the images. High resolution digital cameras record 8 megapixels (MP) images, or more, in true color. Consider an image taken by an 8 MP camera. Since each of the pixels uses 3 bytes to record true color, the uncompressed image would occupy 24,000,000 bytes of memory. That is a lot of storage space for just one image, and cameras must store many images to be practical. Faced with large file sizes, both within the camera, and later on disc, image file formats have been developed to address the storage problem. An overview of the following image file formats, JPEG, GIF, TIFF, PNG, BMP is given below.

Image file compression

The two categories of file compression are: lossy and lossless. The lossy compression algorithm takes advantage of the limitations of the human visual senses and discards information that would not be sensed by the eye. The loss of information is tolerable, and in many cases goes unnoticed. Files size is reduced as file compression is increased. At a point image deterioration becomes noticeable. Lossless algorithms compress the image data with no loss in image quality, but this results in larger files than the lossy algorithms.

A comparison of the images displayed below show the greater file size of images saved in the PNG format. The photo, when viewed at its full 4 MP resolution, will show differences in quality.

File:CandyJaracp.jpg
JPG file size 877 KB
 
PNG file size 4,043KB




Major graphic file formats

There are many graphic file formats, if we include the proprietary types. The PNG, JPG, and GIF formats are most often used to display Internet images. These graphic formats are listed and briefly described below.

JPEG

The JPEG (Joint Photographic Experts Group) image files are a lossy format. The DOS filename extension is JPG, although other operating systems may use JPEG. Nearly all digital cameras have the option to save images in JPEG format, some at different compression levels, such as “fine” and “standard.” The JPEG format supports full color and produces relatively small file sizes. Fortunately, the compression in most cases does not distract noticeably from the image. But, JPEG files do suffer generational degradation when repeatedly edited and saved. These files are best kept in original form. Because of the compression algorithm “artifacts” (blemishes) sometimes appear.

TIFF

The TIFF (Tagged Image File Format) image files are a lossless format, using the filename extensions TIFF or TIF. Some digital cameras have the option to save images in the TIFF format. These files use the LZW compression algorithm which results in lossless files. Because no image data is lost, this format is used when the ultimate in image quality is desired. Another advantage of TIFF files is that they suffer no generation degradation during file manipulation. The TIFF files support 32-bit color depth (true color). The TIFF file sizes are larger than the JPEG file sizes, because JPEG takes advantage of its lossy compression. The TIFF image format is not widely supported by web browsers, and should not be used on the Internet. ya ya ya smelly cat

RAW

The RAW image format is a file option available on some digital cameras. It uses a lossless compression and produces file sizes much smaller than the TIFF format. Unfortunately, the RAW format is not standard among all camera manufacturers and some graphic programs and image editors may not accept the RAW format. The better graphic editors can read some manufacturer's RAW formats.

Exif

The Exif (Exchangeable image file) format is an algorithm incorporated in the JPEG software used in most cameras. Its purpose is to record and to standardize the exchange of data between digital cameras and editing and viewing software. The data is recorded for individual images and includes such things as; camera settings, time and date, shutter speed, exposure, image size, compression, name of camera, color information, etc. When images are viewed or edited by image editors, such as Paint Shop Pro, all of this image information can be displayed.

  • A listing of the EXIF metadata for the JPG candy jar image can be viewed by clicking the small icon below the image.

PNG

The PNG (Portable Network Graphics) file format does almost everything that the GIF format does and does it better. The PNG file format supports true color (16 million colors) whereas the GIF file format only 256 colors. PNG excels when the image has large areas of uniform color. The lossless PNG format is best suited for editing pictures, and the lossy formats like JPG are best for storage because of smaller file size. Many older browsers do not yet support the PNG file format. The Adam7-interlacing allows an early preview even when only a small percentage of the data of the image has been transmitted.

GIF

The GIF file format is limited to an 8-bit pallete (256 colors). As a result, it is not used for photographic work. It is still used extensively on the Internet because of the great reservoir of GIF images available, and because it supports animation. But, is being superseded by the PNG format. The GIF format does well with images having 256 colors, or less. It is not at all suitable for photographs.

BMP

The BMP (bit mapped) format is used internally in the Microsoft Windows operating system to handle graphics images. These files are typically not compressed resulting in large files. The main advantage of BMP files is their wide acceptance and use in Windows programs. Their large size makes them unsuitable for file transfer. Desktop backgrounds and images from scanners are usually stored in BMP files.

XPM

The XPM format is the default Unix picture format (very popular in the Linux world). Is based on the C language string format structure. Is one of the very rare picture formats can be edited with a simple text editor. By the fact xpm is a text format, the file size from these pictures can get as large as double as from uncompressed binary bitmap files (like bmp, tiff, MacOS-pict or Irix-rgb). Sadly, this format is missing on support by some proprietary software and operative systems.

Other graphic file formats

MrSID

The MrSID (Multiresolution Seamless Image Database) format is a wavelet compression format used mostly by Geographic Information Systems to store massive satellite imagery for map software.