Comparison of Photographic File Types
Viewing quality versus file size
Why file sizes are important
JPEG and JPEG myths
TIFF
PNG
RAW
Recap
There are historical, practical and technical reasons for the existence of so many file formats in digital imaging and photography but four of the most common file types used for photographic images are JPEG, TIFF, PNG and RAW. With the exception of RAW (which is like a digital negative) these files all contain bitmap data and they can all be opened in bitmap (or pixel) editors like Photoshop and Picasa
In addition, editors like Photoshop and Gimp have their own native files types (.psd and .xcf respectively) which allow images to be saved with lots of extra information about any layers, masks, channels and selections which have been applied during editing. This is where you begin morphing from the world of straight photography into the worlds of digital art and illustration
Layering is a very powerful technique that is heavily used by artistic photographers and graphic designers. Some photo artists build up a single image using hundreds of layers to get the exact effect they want but the working file sizes can be huge and you need a very powerful computer to handle and process such images. However for learning digital photography we just need to know about the 4 main file formats and the pros and cons of each
Image quality versus file size
While writing this article I tried a little experiment just for fun on a JPEG file and saved copies of it in TIFF, PNG and BMP formats. I included BMP because even though it is a useless image format I notice that many people often incorrectly use it for web images and when emailing photos. The difference in the resulting file sizes was striking yet there was no discernable difference in the viewing quality of the images when they were compared on the screen. Take a look at the file sizes:
The full size images were 600x400 pixels and I could not see any difference in them at all. These little experiments can be illuminating ;-) because when you see something like this with your own eyes you ask questions that make you think about the reality of what you are seeing
Next I took a 4.8 megabyte JPEG image from my portfolio and saved TIFF and PNG versions. The PNG version was 21 megabytes and the TIFF was 29 megabytes!
If TIFF's have such a larger file sizes than PNG then why do some people continue to advise photographers to use TIFF's for their working images? There is also the added headache with TIFF in that the format has been changed several dozen times over the years meaning that there is a doubt about future software packages being able to read ancient TIFF file formats
Why image file sizes are important
When you work with large TIFF and PNG files you can easily run out of computer memory if you are doing heavy editing with layers. For working with these files it is better to buy as much memory as your computer motherboard can accomodate. The other day I was working with a 20 megabyte PNG file but during an editing session my editor warned me that it needed 135 megabytes of memory and that Gimp had only been allocated 128 megabytes. I have 1 gigabyte of RAM and it's not enough! This is another reason why I prefer working with JPEGs and besides I dont have pots of money to throw at my photography
Photographic images that are to be used on websites should be saved as JPEG or PNG. JPEG is the format of choice for web photos because you can save them at a quality level of around 65% and achieve a huge reduction in file size with no real loss of viewing quality. PNG files are used on the web mainly by web designers because they allow them to create snazzy photographic images with transparent backgrounds
At the opposite extreme your originals need to retain the best quality possible which means you need to preserve the original file sizes to retain all the extra picture infomation. What I consider to be a large file size would pale in comparison to what some people end up with. When you use TIFF and RAW you can end up with working images that are between 100 and 200 megabytes in size. That is a lot of data to manage and worry about and the payoff is not worth it in my opinion because there is usually no difference in viewing quality of the images
JPEG and JPEG myths
Designed for images of photographic quality having a continuously smooth tonal range, JPEGs are suitable for anything from web images to finished portfolio images. JPEG is a lossy file format because the camera sensor data is passed through a compression algorithm to obtain much smaller file sizes than TIFF and RAW. JPEG is the photographic equivalent of music mp3 files which are created by passing the original CD file through a filter which removes frequencies which most humans can never hear
Each time you edit and save a JPEG the quality degrades slightly because a compression algorithm is run every time you edit and save it. If you work exclusively with JPEGs then it is better to use copies of your original shots for creating your masterpieces
There is a good read here that explains some common JPEG myths. It supports my preferred solution and advises you to convert JPEGs to PNG files if you are planning on editing an image over multiple sessions
Michael Furtman wrote a good article on JPEG myths which compares JPEG and RAW versions of the same image. He also gives some information about an experiment he performed by saving a JPEG file repeatedly
Here is a very good JPEG v RAW article by Ken Rockwell that tells you like it is
TIFF
A lossless file format often used for archiving original images and work in progress. TIFF files are big and have an additional problem because there are so many variations of the format. This may have future implications because you cant guarantee that future software will open your old TIFF files. You have this same problem with RAW files because RAW is not yet an open format is still largely proprietary in nature
PNG
PNG supports 8 and 16 bits per pixel and can also contain Gamma and chromacity data. It is a lossless format like TIFF but it uses far less disk space and for this reason it is becoming the archival format of choice for some photographers. PNG images can opened, edited and saved repeatedly like TIFF's without losing image quality
RAW
All cameras have a white balance (colour correction) setting that you can change on the spot to match the shooting conditions - bright, cloudy, tungsten light, fluorescent light etc. The main advantage of shooting RAW is that if you fluff and forget to use the correct white balance setting you can still make white balance changes to your images in camera. Some say that with RAW files you can recover blown out highlights and shadow detail which is underexposed but I feel that if you get your exposures right in camera then you will always get good images
When faced with high contrast lighting conditions you can always put the camera on a tripod and take several shots of the scene. You can later superimpose two images, one exposed for the highlights and one exposed for the shadows, in your image editor and experiment with layer masks and layer blending modes
Using RAW is matter of personal preference and I would not advise using it unless you know the reasons why you are doing so. Some professionals shoot exclusively in RAW because it offers them more flexibility and they swear that it gives better quality. Many professional photographers disagree with this hypothesis however and for some very sound reasons. As I always like to say it is a case each to their own and you should just do what works best for you.
Recap
- RAW - master copies (digital negatives) for those who shoot in camera RAW
- JPEG - master copies and can used for almost anything including printing. Versatile
- PNG - Great for web page design
- TIFF - for archiving