An Introduction to Photo File Formats

Every two weeks, we revisit some of our reader favorite posts from throughout the history of Phototuts+. This tutorial was first published in November of 2009.

Having a sound knowledge of file formats is essential for digital photography and image manipulation/editing. This article explores the different file formats involved in taking the photographs, their pro’s and cons, as well correct use of file formats in a digital workflow. The last section concerns the best file formats for printing, the web, and sharing with friends & family.


Step 1: In-Camera Formats

When you take a photograph, the image is stored on your memory card. In order to fit more photos on the memory card, your camera compresses the photos. This process is known as encoding. Photos can be encoded in certain ways, and whether you’re using a compact camera or a Digital SLR the photos are encoded in JPEG format by default. Many cameras can be set to encode your photos in a variety of ways, each with its distinct pros and cons.

In order to find out what variety of file formats your camera can encode, it’s best to check your manual. Alternatively if you feel that consulting a manual is for the weak, fiddle with your camera until you stumble across what’s on offer!

General camera types and the formats they can encode:

Point & Shoot (budget digital cameras under $200):
Generally cheaper digital cameras can only take photos in JPEG format.

Compact (digital compact cameras over $200):

If you own a compact camera, as well as JPEG you may be able to take photos in RAW format. Check your manual to make sure.

Digital Single Lens Reflex:
All Digital SLRs cameras can shoot in JPEG and RAW. Some can also use TIFF and RAW+JPEG.


Step 2: Format Pros and Cons

In this next section, we’re going to look at the various pros and cons of using different formats.

JPEG (Joint Photographic Experts Group)

JPEG is great for general photographic use. Used by all digital cameras, JPEG is a lossy format, which means it sacrifices some quality to ensure minimal small file size.

The advantages of using JPEG:

Small file size: Fit more images on your memory card and transfer images to your computer faster.

Take photos faster! A smaller file size means the image is written to your memory card quicker, so you spend less time waiting and more time taking photos.

Some DSLR cameras can take photos in rapid succession, called a continuous buffer. Using JPEG the camera is able to take photos very quickly for a longer period of time in comparison to RAW.

JPEGs can be viewed on any computer without third party software.

The disadvantages of using JPEG

When capturing an image in JPEG, the noise is softened and the image is generally sharpened.  Also the camera typically reduces the image depth from 12 to 8 bits. There’s a loss of detail and quality.

Suggested use for JPEG format

JPEG is the best format for general photographic use, such as holidays and social events where you need to take photos quickly and don’t want to be waiting for your camera to save larger files such as RAW and TIFF.

(Note: Many cameras have a choice between JPEG, JPEG fine, JPEG large. Typically, a JPEG fine/large photo is double the file size of a normal JPEG photo.  The difference in quality between JPEG large/fine and a normal JPEG is noticeable depending on the size of the print.

RAW

RAW files are uncompressed and unprocessed. RAW files must firstly be processed using third party software before they can be printed or edited. Popular software for processing RAW files is Adobe Photoshop, Adobe Lightroom and Aperture (Mac only).

The advantages of using RAW

The main advantage to shooting with RAW files is that the image processing is done on the computer. This means if you are about to take a photo but you don’t know which white balance or exposure settings are best, you can simply take the photo and perfect these settings later on your computer.

For an awesome tutorial on processing your RAW files in Adobe Camera RAW (included with Photoshop) check out this article on Phototuts+.

Another advantage of RAW is that it is a lossless format. This means that the image does not lose any quality or information (unlike JPEG). As a result, RAW files are much larger than their JPEG counterparts, bringing me to…

The disadvantages of using RAW

Larger files means less images can fit on a memory card. RAW files are typically four times larger than the same image encoded into JPEG format.

RAW files take longer to save to the memory card, and the continuous buffer doesn’t last as long as JPEG.

Processing multiple RAW photos can be tedious and time consuming.

A major flaw with RAW format is that there is no single RAW format. Every manufacturer has their own variation of RAW. This means it is possible that the RAW photos you take today may be incompatible with future software.

Suggested use for RAW

Whenever your image has to be of maximum quality, use RAW (e.g. commercial/freelance work or treasured family photos)

Whenever you can’t decide what the best white balance and/or exposure settings to use (e.g. when taking photos of young children/pets who won’t sit still, take the jolly photo and tweak the settings later!)

TIFF (Tagged Image File Format)

TIFF is included in most professional SLR’s. In short TIFF (like RAW) is uncompressed. However when you take a photo using TIFF you have to choose the exposure and white balance before you take the photo. Think of it this way: TIFF is like an uncompressed JPEG.

Suggested use for TIFF

TIFF should be used when you need your image to be maximum quality, but you have the time to tweak the white balance and exposure settings before taking the photo.

RAW+JPEG

When you take a photo with RAW+JPEG (you guessed it) your camera makes two copies of the photo, one RAW and one JPEG. Using RAW+JPEG carries the combined advantages of both RAW and JPEG. The only problem is your memory card will fill up much faster and your camera may take a little while to write both images into the memory card.

Suggested use for RAW+JPEG

(Note: The main purpose of JPEG is small file size convenience. When you take a RAW+JPEG, it partially defeats this purpose because not only do you have a JPEG, you’ve got a big fat RAW image as well.)

My suggested use for RAW+JPEG is when you’ve got time to set up the white balance and exposure, yet accept that you’re only human so you might make a mistake. Lucky when you take the photo it will save a RAW file as well so if the image turns out bad at least you’ve got the RAW file you can edit.

Okay, so now you’ve chosen what file format suits you, let’s continue!


Step 3: File Formats & Workflows

Consider the following situation:

You’ve been asked to create a photo montage of the beach. You go to the beach, take all your photos in JPEG then go home. When you’re at home you load all the files onto your computer. You edit each photo in Photoshop, tweaking the brightness/contrast and curves. You then save each image as a JPEG. You then combine all your edited images into Photoshop and create your montage. You then save the image as a JPEG to share with your friends. You realize the colors are too bright so you open up the JPEG, tweak, then resave.

What’s wrong here?

As you now know, each time you take an image in JPEG format it loses quality. Let’s say (hypothetically) that each time the image is saved in JPEG it loses 5% quality:

Step:Quality Loss:Total Quality:
Taking the photo in JPEG.5%95%
Editing the photo and then saving as JPEG.5%90.25%
Importing the JPEG, creating the montage then saving as JPEG.5%85.74%
Tweak colors then resave as JPEG5%81.64%

As you can see, throughout the workflow the image keeps losing quality. 5% each time may not sound like much, but it all adds up. The best way to fix this problem is to use uncompressed files. Below is a suggested workflow (using Photoshop to edit images):

  • Firstly, take your images in RAW or TIFF format.
  • If you chose RAW format, process the image then save as a TIFF.
  • Now open up your image editing software (in this case Photoshop) and edit the image.
  • When you have finished editing, save as TIFF.
  • Create a new Photoshop document, and create your masterpiece.
  • Save the document as a .PSD (Photoshop only).
  • Save final TIFF.

Congratulations! Your image still retains 100% quality! Now if you have to make a change, you can open up your Photoshop document .PSD and make a change, then resave as a TIFF.

Using this method, your file sizes are much bigger than JPEG. That shouldn’t really be a problem as most people nowadays have fairly large hard drives. Note: Professionals never sacrifice quality for a small file size!

Now that you have your final image as a TIFF, you want to share it with the world! There are two ways to go about this:


Step 4: Optimisation for Print

So you’ve created your masterpiece, and now you want to print it. If you’ve followed the suggested workflow (listed in section 3) your image is still in TIFF format. TIFF is widely accepted as a standard printing file format, so you’re in good hands.

Before we continue, I have a little observation. Look closely at your TV or computer screen (and I mean really close!)

 

photo file formats

 

You will see that your screen is made up of many RGB sub pixels – that is, red green and blue. As you may know, the colors red green and blue can be added together to create a vast number of individual colors:

 

photo file formats

 

Now this is great for viewing on computer screens, but when it comes to printing there is another solution: CMYK or Cyan, Magenta, Yellow and (K) Black. The reason we want to change our image from RGB to CMYK is that in the printing industry, CMYK is standard. To get the most accurate representation of what your image will look like when printed, you must change your image mode to CMYK. To do so (in Photoshop) click Image > Mode > CMYK then press OK (note that this will flatten your image, so make sure you have a copy saved in RGB if you want to modify later). Now you’re ready to print!


Step 5: Optimisation for Web

This process is all about a healthy balance between quality and file size. Remember: Most people have a monitor between 17 and 24 inches in size, therefore the ideal image size for the internet is 800×600. This means people with a 17” monitor can see the whole image, without having to scroll left or right.

We need to keep the file size to a minimum, as people today are not willing to wait for large files to load. I should know – I live in Australia (land of the slow internet!). An ideal image size for 800×600 photos is less than 100kb. That means that the images retain most of their original quality, yet load in less than a second. As far as file formats are concerned, you can’t beat JPEG.

Below I have two JPEG images of my favorite stapler. Image 1 is the original, and Image 2 is the optimized image. Keeping in mind the rule of thumb, 100kb for an 800×600 image, the images below should ideally be 50kb as they are half the size (400×300).

Image One: Original JPEG 129Kb

photo file formats

Image Two: Optimized JPEG 29Kb

photo file formats

As you can see both images look very similar, yet one will load four times faster than the other!

The steps for optimizing images in Photoshop are:

  1. Open up your image
  2. File > Save for web and devices
  3. Set the preset to JPEG and tweak the quality until the image looks satisfactory

This process involves trial and error, as some photos will look good with a JPEG quality of 40 or less, others need to have a quality of 70 or 80 to look satisfactory.

I hope you’ve found the tutorial useful, and invite you to share any other tips and thoughts about image file formats in the comments!

  • ZLov

    Another valid reason to shoot Raw+JPEG is so that you get thumbnails. Do you really want to sit around waiting for a 10mb RAW to load when you’re going through dozens of photos?

    When I get back after taking a tonne of photos, I look at all the JPEGs, because they’re -far- smaller and faster to load, delete the unsatisfactory photos (and their RAW counterparts), then proceed to process the RAW files. This way at any point I can check the composition, blur and so on very, very quickly.

  • Bryan

    Very informative, thanks for the tutorial!

  • http://peewee1002.co.uk Peter Sawyer

    I did know alot of the top bit but this is a fab article and I would recommend it to anyone buying a SLR or getting into photography.

  • Glyn

    No offence but this whole article seems to be pro RAW format, RAW is a cool format dont get me wrong but JPEG is not worse than RAW in image quality if both shots are taken correctly theres no difference. and in camera noise reduction can be switched off, so can sharpness, a JPEG is just the RAW data dumped from the camera and processed in the hardware. Infact JPEG can have better sharpness and less noise than RAW as the camera can sometimes provide better reduction. And also you cant recover everything in RAW only some shadows and some highlights. Im just waffeling now I know lol but while i on it Digital Cameras dont capture the full range of zones so if were being picky film is better than RAW hehe. Ah and on the image editing if you convert your JPEG to TIFF the majority of image editing you do to RAW can be achieved in JPEG also.

    So if you like to spend time at the computer and edit, or you are not fully confident in exposure use RAW and if you just want to take the image get all settings right in camera then use JPEG there both solid file formats.

  • Julius Ponozka

    good article

  • Mello

    Great Info. Thanks!!

  • http://photographyforsoul.com Can Berkol

    two thumbs up.

  • Phil

    Excellent article! I had no idea of the benefits of the TIFF format.

    Thank you

  • Ijoek

    Hey Glyn sit down on this bench and take a load off with lemon flavored shoes on.

  • Aman Manglik

    Hey very informative article .. something perfect for a beginner.. but i would like to get your attention towards a small oversight .. where its mentioned in Step 5 ..”Keeping in mind the rule of thumb, 100kb for an 800×600 image, the images below should ideally be 50kb as they are half the size (400×300).” .. The 400×300 image is actually 1/4th the size as you are halving both the dimensions of a rectangle .. so the size should be around 25kb which you pretty much achieved ..

    Hope the info helps..

    • James David

      Thank you for the correction

  • Kevin Miller

    I switched from JPG to RAW a couple years ago and haven’t looked back. The only negative (no pun intended) characteristic of RAW is that it eats a lot of hard drive space. But that’s why they make external drives…

    The extra post-processing abilities available to RAW, and the greater quality of a lossless format are essential to anyone who cares about taking decent photos.

  • ravi

    Thank you. it is very useful for me.

  • http://www.caranta.com Arthur Caranta

    Great article indeed !!!

    When I first got into DSLR … I did not find any advantage of shhoting in RAW … But, when I was explained by a coworker how/why the RAW format …

    I switched … AND never got back … memory card are getting cheaper and cheaper then size is no longer a huge issue … and the freedom you get from RAW edtiion with tool such as the mightiest DxO is simply stunning !!

    And which Dxo, for instance, the workflow is quite clear and editing is greatly sped up !

    Overall … go for RAW ;)

  • http://www.timgander.co.uk Tim

    Can I just say that when using Save for Web or other similar functions, the software will often strip out your IPTC information and that will include any copyright information you may have embedded. Save for Web isn’t even necessary any more, so I don’t recommend it.

  • bernyk

    thanks for the article, i was in need of a quick refresher on the pros and cons and this did the trick wonderfully

  • http://karvounisphotography.wordpress.com Nick Karvounis

    Perfect tut! Thumbs up!

  • http://www.meredith.edu/grammar/plural.htm horrible, stupid spelling

    this is the direct link to what I wanted to show your:
    http://www.apostrophe.org.uk/page2.html