There are a wide variety of file formats that have been developed over the
years for various purposes. Some compress an image to reduce the file size and
thereby save space. Data has to be saved somehow. A file format specifies how
that data is organized within its allotted storage area.
Different applications have different capabilities as to whether they read a particular format or whether they can save (write) in that format. Some will read but not write. Some will read but will not read the full range of resolutions etc that the format is capable of whilst others may be able to write a particular format but not at certain resolutions etc.
When choosing a format to save in it is important to know the intended purpose of the file. For instance, if you want to create a web page to publish on the internet the file should be saved as GIF or JPEG. GIF is best for drawings whilst JPEG is best for photos. Indeed, JPEG has become a very popular format. If you want to send a photo to a friend this is an ideal format because it can always be loaded into and viewed in a web browser if the recipient has not got a dedicated graphics program.
Many people will debate for ages over the best file format to save photographs in. Whilst there are many formats most are unsuitable for photographs for one reason or another, The problem with saving as a GIF (pronounced jiff) is that it is limited to 256 colours. In life there are many more shades than 256. In case you were wondering 256 colours can be represented by 16 bits so when someone refers to 16 bit colour or you see that as part of the properties on a graphics related screen it means up to 256 colours can be use for the display. Whilst you may think there is, say, light green and dark green how dark is dark green? Take a look at the two colours below.
There are actually many subtle shades in between. To accurately represent the colours we see in life we need far more than 256 colours. If we therefore increase the number of bits we use we can make the numbers bigger. 24 bits allows us around 16 million colours which is quite sufficient to represent a human face, for instance.
So, if we need more colours we need a file format that allows us that range. Fortunately, there are several around. The only problem is that the more bits we have the bigger the resulting file size. Hence the need for some form of compression.
Fractal compression converts an image into a set of numbers which is a complex maths sum consisting of millions of fractal equations added togther. The compression is achieved by throwing away the fractal numbers which have least significance - the bits you'd least notice. So, like JPEGs it is a lossy method. There is, however, a heavy demand on the processor to display the image because it needs to process all the data. Wavelet compression is another method that can be used.
In a bitmapped image (not to be confused with the bitmap format) each pixel is represented by a single number. Vector graphics, on the other hand, use geometry to represent lines. They're much smaller and because the curves which make them up are represented as mathematical formulae they have no real resolution limit.. LZW compression is used in the GIF format. Gradients reduce the compression available dramatically.
JPEG was mentioned above. This comes from the Joint Picture Experts Group and uses lossy compression. This means that it throws away information that it thinks you don't need. It uses cosines and Fourier transforms which is less efficient than fractal compression. The amount of compression can be controlled by the user. At high compression rates there is a noticeable loss of quality, but the file size can be dramatically reduced. Now, if information is being thrown away this is no good for archival purposes since for this we want all of the information to be available. Consequently JPEG is useful for use in email or web pages and most other documents. Dithering is used by the computer to fill in any missing colour information when the image is displayed. The effect will be seen when the computer's colour depth is set to 256 colours or less but it will be reduced by the natural complexity of the image.
JPEGs are always 24 bit images, there is no transparency or animation. A progressive JPEG is effectively interlaced and will appear bit by bit but this often holds up the display of a web page due to the processing requirements. It was invented by photographics scientists (in the Joint Picture Expert Group - hence JPEG) to transmit news photographers' pictures efficiently over phone lines. When the quality is low and high compression is used there is a distinctive blockiness known as artifacts. Interestingly, when telling a browser to use a certain image on a page web designers can specify a low res or 1 bit version (using the LOWSRC attribute) but this can also be used to change one image to another.
TIFF (Tagged Image Format) is a widely available format. It uses lossless compression but the file sizes are still comparatively large. There are many guises to the TIFF format and not all software supports the complete range of its capabilities. For instance, there is a specified format for Fax, another for black and white documents, another for colour. In addition, it supports various forms of compression as well as being able to save in uncompressed format..Many people recommend this format for archiving because of its universality and scope and because of the lossless compression.
Although several types of compression are available LZW is the one often recommended. Lemple-Zif-Welch is not that efficient at compressing full colour images. It is used by the GIF format as well as file compressors such as Winzip. The technique describes rows of identical pixels in one go rather then each one being described individually.
PNG is a relatively new format and was designed for the web. Like TIFF it uses lossless compression, so all the original picture information is retained. Generally, it produces smaller file sizes than TIFF. The files can be viewed in a web browser. Whereas the compression type used in GIF is under a patent to Unisys Corporation the compression in PNG is royalty free.
This format was developed by Compuserve in the mid 1980s as a platform independent, bandwidth conscious way of moving graphics across networks. They originally gave it away and built the routines to enable applications to use the format. It was the first format that web browsers could view inline. GIF (pronounced "jiff") is limited to 256 colours so is not really suited to photographs. However, one colour can be defined as transparent so that whatever is behind can show through. It can be interlaced (the blinds effect) so that the image when downloaded gradually appears.
GIFs use an internal colour palette to define the colours. Each colour in the palette is defined as 24 bits (8 bits for each of the RGB channels). Each image can have its own palette so two images can look different on the screen which means the application displaying them will have to compromise somehow. In theory the display should be adjusted. Dithering is a common form of adjustment but the results can look ugly. With dithering two colours are mixed to look like a third. The lower the bit depth of the image the fewer the compromises that have to be made but the fewer the colours available in your image. Of course, if you only use a set colour palette you can get round the problem. If displaying for the web use only web safe colours. Netscape has its own palette. Some apps allow you to load palettes and have one specially for Netscape. Using a web safe palette means that the image will look the same on all platforms.
Some applications will let you set the bit depth of an image. It's worth experimenting to see if you can get away with a lower colour depth. This will reduce the file size. And if you are going to have the image on a web page then you will cut down download time which your visitors will appreciate.
When Compuserve drafted the original GIF standard it included a way to layer images sequentially as frames so that they could be displayed on after the other but, it seems, forgot to tell anyone . Some applications will let you export a sequence a an animated GIF whilst there are others that will allow you to build them either from a set of images you have created separately or within the application. Interlacing is not recommended unless you want everything to look like an out of tune television. The animation can loop (ie replay) a set number of times or forever. Bear in mind that people will get bored after a while. The human eye is easily distracted and a flickering image can distract people from the rest of a web page.
Sprites can be placed on top of the first image you use. By specifying the position of the sprites you can keep the file size down and the image will render more quickly. This saves creating each frame in detail.
Graphics Intro Scanning File Formats Drawing Colour
Contents Music Wordprocessing Databases Spreadsheets Graphics Education Glossary Contact Bibliography/links