
Image file formats
There are many different types of formats for storing image files. On this page,only the most commonly used image file formats are discussed. These are: Tagged Image File (TIFF) File extension *.tif Compuserve Graphics Interface Format (GIF) File extension *.gif, Joint Photographics Expert Group (JPEG) File extension *.jpg PC Paintbrush Format (PCX) File extension *.pcx, Standard Windows Bitmap BMP) File extension *.bmp, Portable Network Graphics (PNG) File extension *.png, PhotoShop images (PSD) File extension *.psd, Macintosh format (PICT) File extension *.pic or *. pct, Pixar Image Computers (PIXAR) File extension *.pxr, Scitech continuous tone ( SCITEX CT) File extension *.pxr, Truevision video board (TARGA) File extension *.png, Raw format (RAW) File extension *.raw.
File headers and image data
All image files have two parts. The first part,
known as the file header contains information about image type,
colour scheme and image width and height. The second part, image
data contains the pixel information that actually makes up the image.
Image data are often compressed in different ways to reduce file size.
It is important to be aware of different file formats and compression techniques,
because they affect, respectively, file compatibility and information content.
Tagged
Image File (TIFF)
The tiff file format is a very good format for scanners to acquire image data and so most scanners obtain images as tiff files. The great advantage of saving files in the same tiff format is that no information is lost. Tiff formats are also useful for transporting image files from one application to another or from one computer to another as they are designed to be independent of any particular hardware or software. The drawback of tiff tiles is that the file size is large. They take up a lot of space when stored and take a long time to open in an application. They are not useful as embedded image files in a webpage as they take much too long to download. If you have anough space in your computer, they are useful to keep as an archive so that you can have more than one chance to modify and manipulate the image before saving it in another format.
Figure 1: Tiff tile 150 x 113 pixels = 57 KB
|
Main advantages: (1) no loss of image
data and (2) free exchange between applications and computer platforms
Main disadvantages: difficult to store, large file format. Main use: keep as archival image file with all information intact. |
GIF images are non-lossy ie when converting to gif, no information regarding pixel intensity values is lost. However, gif images are limited to indexed-color graphics. An indexed-color image is based on a palette of 256 colors or less (often this is optional). If your original image contained more colours, these will be lost. This means that gif images are always somewhat limited in the colours they can display. The limited colour range has the advantage that gif files will be smaller than file formats that retain more colours, but if you want subtle colour variations retained in your image, gif may not be suitable. Gif formats are very useful for storing greyscale images which are limited to 256 tones of grey, so that no information is lost. When saving an image as GIF, you can specify how the image appears as it is downloaded. Select Interlaced to display the image gradually in increasing detail as it is downloaded. The GIF89a Gif format is a special variant of gif. This format allows you to specify transparent areas in the image so that the background on which the image is placed will come through the transparancy.
Figure 2: Gif file (216 colours) 150 x 113 pixels = 10 KB
|
Main advantages: small file format, easy
to store and display, can be made into a transparent image.
Main disadvantage: loss of colour variation. Main use: displaying images in greyscale, transparent images or images where colour variation is unimportant but where a small file size is desirable. |
The jpeg format is commonly used to display continuous tone images (such as photographs) on the internet. The important difference with the compusserve graphics interface (gif) format is that jpeg retains all colour in the RGB colour format. However, the jpeg format uses a compression technique that discards data not essential to the display of the image, and therefore is categorised as a "lossy" file format. Although up to 16,000,000 colour variations are retained, jpeg compression loses information on pixel frequency values because certain pixel values may be averaged to the values of those pixels in its immediately surroundings. The level of jpeg compression will determine how much information is lost (this can be set in most programs that offer jpeg compression). The lower compression level with quality set at maximum produces a result that is virtually indistinguistable from the original. Because jpeg retains full colour, the file size of an image in jpeg is larger than in gif (compare Figure 2 with Figure 3). Jpeg files can be saved with the following options: "standard", "baseline optimised" and "progressive". "Baseline optimised" keeps the the colour quality of the image at its best. "Progressive" displays the image gradually as it is downloaded from the web, using a series of scans to provide increasingly detailed versions. Progressive jpeg downloading requires more RAM is is not supported by all web browsers.
Figure 3: JPEG image 150 x 113 pixels = 20 KB
|
Main advantages: retains up to 16,000,000
colours, ability to compress more or less to find a compromise between
file size and image quality.
Main disadvantages: "lossy" file format; file size larger than gif because of colour information. Main use: display of continuous tone images such as photographs on the Web or other online services. |
PCX is one of the oldest raster formats available on PC's and was originally established by Z-soft for its PC based Paintbrush software. Because it has been around for such a long time, there are now many versions of PCX. Most software today supports version 5 of the PCX format. Version 3 only supports 256 colours, but it does not allow for a custom palette. This means that when you open a version 3 PCX file, a standard VGA palette is used instead. PCX retains all image information, similar to TIFF. It is not a compressed file format and hence the file size is large, even larger than tiff (compare Figure 4 with Figure 1).
Figure 4: PCX image 150 x 113 pixels = 63 KB
|
Main advantage: image information
retained, good quality image.
Main disadvantage: large file format, PC compatible only and older PCX versions only support 256 colours. Main use: with Paintbrush software. |
Standard Windows bitmap is the image format designed for DOS and Windows compatible computers. When saving an image in BMP format, it is possible to specify Microsoft OS/2 format. In addition, a 1-bit to 24 bit depth for the image can be chosen. If the image is saved in a 4 or 8 bit format you can also choose to run-length encoding (RLE) compression which is lossless (no information is lost from the image). Non-RLE compression may lose considerable information from the image. The amount of memory a BMP file will take up depends on whether it is saved as a 4, 8, 16 or 24 bit image, which will save the file in 16, 256, 65,536 or 16,000,000 colours respectively. As a 16,000,000 24 bit image, the fila size is rather large (Figure 5).
Figure 5: BMP image (24 bit) 150 x 113 pixels = 50 KB
|
Main advantage: BMP works well with Windows
or OS/2 applications.
Main disadvantage: loss of information, cross-platform incompatibility. Main use: within Windows and OS/2 applications. |
The PNG format was designed to be an alternative
to the gif format, and is also used to display images on the Web. Unlike
gif, the PNG format is able to retain full 16,000,000 colours. PNG can
also retain alpha channels. (Most software for image manipulation
use colour channels such as CMYK: cyan magenta, yellow and black.
These channels represent information about the colours of the image
and are analogous to plates in a printing process where separation plates
are used for different colours. Alpha channels are additional colour channels
used for storing and editing masks: areas isolated and protected
from the main image).
The PNG format uses a lostless compression
method (no information is lost from the image). This means that an image
saved as a 24 bit file remains rather large. The relative large file size
ensures PNG format may sometimes be less suitable for Web or other
online service publications than other high-compression file formats. When
saving in PNG format, it is possible to select Adam7 for interlace.
This will display the image in gradually increasing detail as it is downloaded.
It is also possible to select different kinds of filtering algorithms used
for preparing the image for compression.
Figure 6: PNG image (24 bit) 150 x 113 pixels = 51 KB
|
Main advantages: preserves alpha channels
and full colour range. Lostless file preservation.
Main disadvantages: relatively large file format Main uses: web pages, preservation of channels for masks and/or printing. |
Photoshop image file formats are useful because of the preservation of image layers, channels and paths. An image can be built up out of several layers, e.g. a foreground image against a background layer. If these layers are preserved, each layer can be edited separately. Channels preserve colour information in separate colour separations - such as RGB (red, green, blue) or CMYK (cyan, magenta yellow and black) - which optimalises the image for display and/or printing. Having paths in Photoshop are like placing a piece of tracing paper over an image and drawing lines and curves. Paths can be used for preserving areas within the image for painting, as masks or for printing. PSD formats are specific to Photoshop although other image manipulation software programs are able to open and work with PSD files.
Figure 7: PSD image 150 x 113 pixels = 5O KB
|
Main advantages: good format for manipulating
and changing images with control over separate image channels, layers and
paths.
Main disadvantages: only works within certain applications, not useful for display on the web or other online services. Main use: save images in PSD format as a useful "working tool" for further image manipulation and adjustment. |
The PICT format is widely used in Macintosh graphics and page-layout programs and is particularly useful as an intermediary file format when transferring an image file between different MAC applications. Its compression method is effective in reducing the file size of images that contain a lot of solid colour. This may be particulary useful for alpha channels which often consists of large areas of white and black (for more information about alpha channels go to Portable Network Graphics (PNG).) A colour (RGB) PICT file can be saved in 16 bit or 32 bit whereas for greyscale the choice exists between 2, 4 or 8 bit.
Figure 8: PICT image (16 bit) 150 x 113 pixels = 34KB
|
Main advantages: for Macintosch platforms
and as an intermediary between Macintosh applications. Effective compression
of solid colour blocks.
Main disadvantage: limited to Macintosh computers and applications. Main use: Macintosh applications. |
The pixar format is compatible with PIXAR computers which are designed to be high-end graphics workstations. Pixar computers are typically used for making 3D images and complex animations.
Figure 9: PIXAR (PXR) image 150 x 113 pixels = 50KB
|
Main advantage: compatible with PIXAR
workstations.
Main disadvantage: specific to PIXAR workstations, no compression and not suitable for Web or other online publications. Main use: with PIXAR workstations. |
The Scitech file format is used with with Scitech computers which are used for high-end image processing. The scitech format is can save images that are in grayscale, RGB colour and CMYK colour, but when these files are converted to a Scitech format, it is kept as CMYK colour. This means that the files are often very large, with a raster system that contains colour separations. Scitech files are therefore very useful for professional colour work with a high print quality, such as ads that run in glossy magazines.
Figure 10: Scitech (SCT) image 150 x 113 pixels = 52KB
|
Main advantage: high level of colour separation
and print quality.
Main disadvantage: specific to Scitech systems. Main use: image file format preserves high-quality colour separations, useful for producing very high quality prints. |
The TARGA file format is supported by DOS applications and is used with computers that have a TrueVision video digitising board. If the file is saved as an RGB colour image, it is possible to select the colour depth (16, 24 and 32 bit).
Figure 11: TARGA (TGA) image 150 x 113 pixels = 34KB
|
Main advantage: supported by DOS applications
and TrueVision digitising boards.
Main disadvantage: Limited to DOS applications. Main use: specific file format for TrueVision digitising boards |
The RAW format is a flexible format able to be used between applications and between computer platforms (eg PCs and Macintosh). You can specify the file extension (in Windows), file type (in Macintosh) and file creator (in Macintosh). In the Macintosh, the file type is usually a four character ID that specifies the file e.g. TEXT identifies the file as a text file. The file creator is generally also a four character ID, which is a registered identifyer for Macintosh applications.The header specifies the number of bytes of information that will appear before the actual image information. It is possible to specify no header information,or one can specify the width and height of the header values as required. It is possible to store RAW images in an interleaved or noninterleaved file format. The interleaved file format stored the colour values (red, green and blue in the RGB format, for example) sequentially.
Figure 12: RAW image (interleaved) 150 x 113 pixels = 50KB
|
Main advantage: cross-platform format
that can be used by many applications.
Main disadvantage: many specifications have to be set. Main use: as an alternative to tiff files. |
For more information, contact:
Email iaaf@iaaf.uwa.edu.au
Tel: 6488 8649 Fax: 6488 1051