Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

Saving Your Work (File Formats Explained)

This page is aimed at beginners. Here I quickly go through some common file formats, giving their advantages and disadvantages. There is also a brief discussion of compression too.

Chances are, at some point you are going to want to save your work so you can view it later. Maybe you will want to distribute your pictures to other people? But, merely saving a file to disk isn't as easy as it sounds. There are so many different ways to do it...

Why do I need to worry about file formats?

What is compression?
Lossy compression versus Loss-less compression

Comparison of file formats
JPEG; Progressive JPEG; GIF; TIFF; Bitmap (BMP); PhotoCD (PCD); Flash Pix (FPX); Adobe Photoshop (PSD); Micrografx Picture Publisher.

Summary: Which format is right for me?

Why do I need to worry about file formats?

Most things in the world of computers can be done in many different ways. Saving data is no exception. There are many different standard file formats (layouts of the file) for graphics data.

The obvious question is, "Why not just pick one format and stick to it?". The answer is that no-one format offers all the facilities you could ever want. Stupid, but that's the way it is. Some formats are good for storing photos, others are better for logos and graphs; some formats store editing information about the picture, others do not. Each format has some merit which the other do not. I'm here to help you choose which format is right for you.

What is Compression?

Graphical data i.e. images, tend to be very big. The amount of memory they use is huge. A 6x4 photo, at 150 dpi, 24-bit colour (I hope you've been following the other articles) will require about 1620000 bytes of storage (1.6 Mb almost). That's quite a lot for such a small picture - more than one floppy disk's worth.

Compression is the solution to this. Compression reduces the size of the image while it is not in use (i.e. on disk). Note that it is a rare day when it is possible to work on a file when it is still compressed - usually, it must be decompressed in RAM first.

Compression achieves this feat by removing part of the image while it is stored. So instead of storing, say "pixel 1 is black, pixel 2 is black, pixel 3 is black, ...", it will instead store something similar to "the first three pixels are black".

Going back to my earlier comment, there is still more than one way to do this. There is lossy compression, and loss-less compression.

Lossy versus Lossless Compression

The two different compression methods arose with different uses in mind. The first type is lossless compression. Lossless compression removes data from the image, but in such a way that it can reconstruct all of the data when you want to use the image.

Graph GIF Consider the graph picture you should see nearby. This image is stored as a GIF file format, which uses lossless compression. You would never know the image was compressed, except for the fact that the original uncompressed file was 339K big, whereas the GIF is only 7K big - that's 48 times smaller.

The alternative to lossless compression is lossy compression. Lossy compression is so called because it loses some of the detail in the picture. This means the picture is lower quality, but much smaller than it would otherwise be possible to make it.

Blue to Black gradient; high quality JPEG.Blue to Black gradient; low quality JPEG. Consider the two nearby pictures of my old friend, the blue-black gradient. The first picture on the left is using a high quality lossy compression. Looks pretty good. In fact, it looks the same as the original (which I can't show you here). The original file was 66K - the high quality compressed file is only 11K. Not bad. The second picture is on the lowest quality lossy compression. This looks terrible! The gradient has become a series of distorted bands instead of my smooth gradient! But, the image is now only 2K big.

Most of the time, if lossy compression is going to let you down, it will be on smooth gradients like this, where it approximates the colour changes. This often shows up in the sky in photos. But for most photos, lossy compression is fine - and it lets you compress the image much more than lossless compression. (If I increase the compression of the high-quality picture from minimum to about 3%, the image still looks much the same, but the file is only 5K big. A lossless compression can't produce better than an 11K file.)

So, to summarise: lossless compression is good on simple images, with large blocks of plain colour, such as graphs and logos. Often this will be better than lossy compression, and at higher quality. But for photos, lossy compression will produce much bigger size reductions, with user-selectable loss in quality, ranging from almost none to lots.

Comparison of File Formats

File format Filename Extension Suitable For... Description
JPEG (Joint Photographic Experts Group) .JPG or sometimes .JPEG Storing photos;
Passing photo images to other people;
Web graphics.
JPEG is one of the two graphics file formats commonly seen on the World Wide Web (the other being GIF). JPEG is a complex format, which requires a fair amount of processing power to read, and even more to write (although modern PCs are more than able to cope). It can only store images with 24-bit colour data or 8-bit greyscale data, but at least this is as much as you would need of it.

In return for this limitation, JPEG offers better compression for photographic images than most other formats. It employs a lossy compression, so photographic images several megabytes big can be compressed to only a few hundred kilobytes or less.

Progressive JPEG .JPG or .JPEG As JPEG, but biased to web use. Not strictly a separate format, Progressive JPEGs are still unrecognised by a lot of pieces of software. A progressive JPEG is essentially a normal JPEG, but with anything from 1 to 10 'passes' defined for it; this means, when the JPEG is first loaded, it displays a low-resolution version of the picture, then a higher resolution version, and so on until the correct number of passes has been performed. This has a similar effect to Interlaced GIFs - it decreases the perceived time to load the image (the first low-res image can be decompressed and displayed quicker than the full image can). Progressive JPEGs can usually be recognised on the Web as the first pass will often be greyscale, turning to colour on later passes.

Progressive JPEGs do not increase the file size of the JPEG, nor do they increase the compression offered.

GIF (Graphics Interchange Format) .GIF Storing simple images with few colours e.g. graphs;
Producing animated logos for the web;
General non-photo web images.
GIF is the other graphics file format used commonly on the World Wide Web, alongside JPEG. GIF is a highspeed format, offering lossless compression and a host of other features that make it attractive to web site creators. GIF images can have a maximum of 256 colours. This means they are unsuitable for representing photographic images genereally. The compression method of GIFs is also very simple, which means photographs don't tend to compress very much. Simple graphics with large blocks of the same colour compress very well though, and can be decompressed very fast.

GIF offers three other major features: multiple-image files (used to produce animations on the web), transparency (where the background shows through parts of a GIF image on a web page), and interlacing. Interlacing alters the file, such that when the file is decompressed, a low-res version is generated first (using just the odd lines), then the full picture appears as the even lines are decompressed and drawn. This makes the file slightly bigger, but can look nice, and decreases the perceived time of the image download by the user.

Many programs that used to support GIFs do not anymore, due to licensing complications with the creators of the GIF format. Commercial programs can usually afford to pay the licence fees, but shareware or freeware products often can't.

PNG (Portable Network Graphics) .PNG In theory, web use.
In practice, not yet.
Designed as a replacement for the JPEG and GIF formats, PNG has yet to catch on in any big way, mainly due to the large number of web browsers which still don't support it. PNG supports most of the features of JPEG and GIF, including transparency information, compression, and support for images with anything from 2 colours (1-bit) up to 16 million colours (24-bit) and beyond. However, PNG lacks a compression system to rival JPEG, and so it is not so efficient for photographic pictures.
TIFF (Tagged Interchange File Format) .TIF or .TIFF Transfering images to professional printers; DTP. TIFF is a format more commonly seen on the Apple Macintosh. It is possibly the world's most standard least-standard format. No mistake. A very extensible format, capable of storing picture information upto and beyond 24-bit. It also supports alpha-channels (i.e. masks), and various compression methods. Although the base TIFF format is a standard, TIFF's extensible nature means there are many custom variations, which mayb only one program will support.

TIFF files are still often used for transfering images to professional printing companies.

TIFF files can also support a "Fastbits" editing method, whereby only the part of a large image file being edited is actually loaded. This requires the image to be uncompressed, with no mask, however.

BMP (Windows BitMaP) .BMP Making desktop wallpaper for Windows. Windows Bitmap files are an incredibly basic file format, which is often seen on Windows systems as the absolute base method of transferring files. Bitmaps support pictures upto 24-bit colour depth, but offer no advanced features. Some very simple compression is possible, although this is ineffective against photographics images. Any image stored as a BMP file is about as large as it can ever be.
Photoshop Files .PSD Storing pictures which you might want to edit in the future. (If you have Photoshop.) PSD files are generated by Adobe Photoshop. They are capable of storing images with varying numbers of colours, but don't have any real compression capabilities. The only real need for Photoshop files is if you use Photoshop yourself. A PSD file will store all the information that Photoshop works with, including Alpha channels, layers, effects and other information. This means that if you save your work from Photoshop in a PSD file, you can reload it later and carry on where you left off.
Picture Publisher Files .PPF or .PP5 for the old Picture Publisher 5 format. Storing pictures which you might want to edit in the future. (If you have {Picture Publisher.) Picture Publisher files are similar in principle to Photoshop files. They offer a very limited amount of compression and support varying colour depths. Like PSD files, their main benefit is that they store information about objects, masks, and also a complete list of all the commands used to create the file.
Flashpix .FPX Working on quick, low-res versions of images, later to be made high-res. FlashPix format is another format offering all the standard features, such as compression, variable colour depths, but it also offers one other big feature - resolution independance. What this means is that if you load an uncompressed FlashPix format picture, you can manipulate a low-resolution version of it; then when you want to produce the final high-resolution version, you simply ask the program to rebuild it at the higher resolution. Currently not many programs support FlashPix, although support is building - Picture Publisher 8 supports FlashPix, as does MGI PhotoSuite II (to my knowledge), and many digital cameras are appearing that store images as FlashPix. Some photo-developing services can store images on floppy disk as FlashPix files, complete with a suitable viewer.
Photo CD .PCD Getting your photos put onto CD; used for stock image libraries. Photo CD was a format devised by Kodak (from whom we also have the Multisession CD format). The original intention was that people could have their photographs "developed" onto a PhotoCD, and then if they bought a suitable viewer device, they could view their pictures on their home television. This concept didn't catch on, but PhotoCD still exists for professional (stock) imaging purposes.

Each PhotoCD image stores several image resolutions, varying from a thumbnail size, to a professional size, which is 2000 pixels across or more. When you load the image, the software should ask you which image size you wish to import as.

Although some software can export as PhotoCD images, it generally isn't worth it for normal use. If you want to convert your photos into PhotoCD images, many developer's will create PhotoCDs for you, but it is expensive.

Summary - which format is right for me?

Right, so you've made it through the "Table of Doom", so now you want to know what file formats I recommend. Well, this is actually a lot simpler than the table might suggest. Simply follow these three rules:
  1. If you are going to want to work on an image again later, save it in your image processor's native format - that is, PSD for Photoshop, PPF for Picture Publisher, and so on. Even if you don't think you will want to edit the picture again, it is a good idea saving it in the native format, so that you can change your mind later. This takes more disk space, but the benefits for later editing are well worth it.
  2. If you want to distribute photographic quality images (lots of colours or high detail), especially on the Internet, or are just archiving some scanned images, then you are best off using JPEG format. On the lowest compression setting, this produces extremely good quality, and high compression.
  3. If you want to distribute simple graphics with few colours, especially on the Internet, then GIF is the best format to use; it will give very good compression, and it will be fast.
There, see? It's really that easy!

What's New ]

Main Index ]

Photo Editing ]

Techniques ]

Gallery ]

Email Me ]

Links ]

About ]

Reader Survey ]

Frames On ]


This page was created by James Corrin. All pictures and text belongs to him or the appropriate author. Permission to use any pictures or text from these pages must be sought from the work's author. This page was last updated Saturday 22 January 2000. Email: webmaster@imageeffects.8m.com