RAW vs JPEG

The RAW vs JPEG topic seems like a never ending debate in photography. Some photographers say shoot RAW, while others say shoot JPEG. What is RAW format in digital photography? What are the advantages and disadvantages of RAW versus JPEG and why? Should you shoot in RAW or JPEG? Will shooting in RAW complicate your post-production and workflow? These are some of the most common questions that people ask after they buy their first DSLR camera and go through the camera options. Having a thorough understanding of advantages and disadvantages is essential for photographers to make the right decision on whether to use RAW format for their work.

RAW Sand Dunes

Sand Dunes - Shot in RAW

I remember my first time going through the camera options and reading the Nikon D80 manual, wondering about what RAW does and why I should consider using it. JPEG is a no-brainer – it’s the default image format that is used in most point and shoot cameras and we all got used to it and know it very well, seeing and sharing JPEG images online and downloading/uploading them from and to our mobile devices. But there was something about RAW that I wanted to find out about immediately. Maybe it was the word “raw” that sounded intriguing, maybe it was the immediate desire to get the sharpest, highest quality and best pictures ever without knowing much about the camera…whatever it was, I went ahead and changed my camera settings to RAW and tried to take a picture. The first thing I noticed, was how small all of a sudden my memory card became. Wait a second! How come the number of pictures went down from over 700 to under 200? The image looked exactly the same on the LCD and yet it consumed more than three times more memory? Bummer. Then, I took the memory card and inserted it into my laptop. To my surprise, I couldn’t even open the darn thing! Worthless, I thought and changed my camera settings back to JPEG.

Sounds familiar? If you are in a similar situation, do not make the mistake of abandoning RAW as I once did and read on. You truly need to understand all advantages and disadvantages of both formats before making the decision, because you might be sorry that you didn’t later.

1) What is RAW?

RAW images, also known as “digital negatives” are virtually unprocessed files coming directly from the camera sensor. They are truly “raw”, just like your food ingredients that need to be prepared and cooked before they can be used. Unlike JPEG files that can be easily opened, viewed and printed by most image-viewing/editing programs, RAW is a proprietary format that is tied to the camera manufacturer and sensor, and therefore is not supported by all software products. RAW files preserve the most amount of information about an image and generally contain more colors and dynamic range than JPEG images. To allow digital cameras to display the recorded image on the rear LCD, RAW files typically consist of two parts – the actual RAW data from the camera sensor and a processed JPEG preview. Many image-viewing applications, including the camera LCD, then use this JPEG preview embedded into the RAW file to display the image to you.

1.1) Advantages of RAW format

  1. Compared to 8-bit JPEG format that can only contain up to 256 shades of Red, Green and Blue colors (total of 16 million), 12-bit RAW images contain the most amount of information with 4,096 shades or Red, Green and Blue (equivalent of 68 billion colors!) and higher. On my Nikon D700, I can record 14-bit RAW files, which equates to roughly 4.3 trillion possible colors. That’s a lot of colors compared to 16 million!
  2. RAW files contain the most dynamic range (ratio between the maximum and minimum measurable light intensities of light and black) and can later be used to recover underexposed/overexposed images or parts of an image.
  3. When a RAW image is generated, all camera settings (also known as metadata), including camera-specific and manufacturer-specific information, are just added into the file. This means that the image itself remains unmodified – the settings are only provided as a reference and you can make any changes to them later in post-processing applications like Lightroom and Photoshop. This is a huge advantage of using RAW, because if you accidentally use a wrong setting (like White Balance) on your camera, you will still have an option to change it later.
  4. Due to the number of colors stored in RAW images, the type of in-camera Color Space (sRGB or Adobe RGB) is also not important when you shoot in RAW – you can change it to any color space in post-production.
  5. Unlike JPEG, RAW files utilize lossless compression, meaning they do not suffer from image-compression artifacts.
  6. No image-sharpening is performed on RAW files, which means that you can use better and more complex sharpening algorithms for your photos in your PC.
  7. RAW files can be used as evidence of your ownership of the photograph and authentic, non-modified images. If you saw an alien and took a photo in RAW, nobody would be able to say that you used Photoshop to add the alien to your picture :)

1.2) Disadvantages of RAW format

  1. RAW files require post-processing and conversion before they can be normally viewed, which adds a significant amount of time to workflow.
  2. RAW takes up much more camera memory and space than JPEG images. This means that memory card can store fewer images and camera buffer can quickly fill up, causing the camera frame rate to drop down significantly. You will also need more RAM and much more disk storage on your computer to keep RAW images.
  3. RAW files are not standardized across different manufacturers. For example, Nikon software cannot read Canon RAW files and vice-versa. In addition, not all image-viewers and editors can open RAW files. If you have a brand new camera that just got released, you might need to wait for a while for software companies to catch up and update their software so that your RAW files could be opened and worked on.
  4. You will have to convert RAW files to a compatible format like JPEG or TIFF before you can give them to your friends and clients, as they might not have the tools to view them.
  5. Because RAW files cannot be modified by third party software, your settings will have to be stored in a separate sidecar (XMP) file, which again means more storage and tougher file management (unless you convert your RAW files to DNG).
  6. Due to the size of RAW images, archiving/backup procedure takes much more time.

2) What is JPEG?

JPEG is the most popular image format for photographs today, capable of displaying millions of colors in a highly compressed file. The compression method JPEG uses is “lossy”, which means that certain information is removed from the image. Different levels of compression (in percentage) can be applied on JPEG images, which impacts the quality and size of the image. The more details are preserved, the larger the file.

2.1) Advantages of JPEG format

  1. JPEG images are fully processed in camera and all settings such as White Balance, Color Saturation, Tone Curve, Sharpening and Color Space are already applied to the image. So you do not need to spend any time on post-processing the image – all you need to do is extract the image out of the memory card and it is ready to use.
  2. JPEG images are much smaller than RAW images and therefore consume a lot less storage and need much less processing power.
  3. Due to the smaller size, cameras can write JPEG files much faster, which increases the number of pictures that can fit in temporary camera buffer. This means that compared to RAW, you can potentially shoot at higher frames per second and for longer periods of time.
  4. Most modern devices and software packages support JPEG images, making the format extremely compatible.
  5. Digital cameras provide different compression and size options for saving JPEG images, giving you the flexibility and choice over image quality and size.
  6. Smaller size also means faster and more efficient backups.

2.2) Disadvantages of JPEG format

  1. The “lossy” compression algorithm means that you will lose some detail from your photographs. This loss of detail, especially in highly compressed files, will show up in images as “artifacts” and will be quite visible to the eye.
  2. JPEG images are 8-bit, which puts a limitation of 16 million possible colors. This means that all those other colors that your camera is capable of recording are essentially discarded, when the image is converted to JPEG format.
  3. JPEG images also contain less dynamic range than RAW images, which means that recovering overexposed/underexposed images and shadow areas will be extremely difficult and sometimes impossible.
  4. Since cameras fully process JPEG images, any camera setting errors will be practically irreversible. For example, if you apply too much sharpening to your images, you will not be able to “unsharpen” images later.

3) Should you use RAW or JPEG?

Let’s now move on to the most important question – should you be using RAW or JPEG for your photography?

For me, shooting in RAW far outweighs the advantages of using JPEG. Storage is cheap nowadays and the file size does not bother me, even for backups. Since I already spend a considerable amount of time taking pictures, I do not mind spending a little more time and effort working on them in the digital darkroom. True, if I had to process one image at a time in Photoshop, I would have abandoned RAW altogether, because I wouldn’t have the time to go through tens of thousands of pictures. Thanks to such wonderful post-processing tools as Adobe Photoshop Lightroom, I can work on my images in batches and I can spend very minimal amount of time on individual post-processing (when needed).

But time and size are small issues, compared to my ability to recover details from a RAW picture. Like many other photographers, I have been in situations where the light was not ideal and I either trusted my camera and had no time to correct the exposure or made a mistake, which led to a badly exposed image. If I shot in JPEG, those details would be gone forever and I would end up with a trashed image. But since I used RAW, I could easily adjust the exposure and change other settings and still have a good shot. This makes a huge difference, especially for rare, special moments that cannot be reproduced ever again.

Take a look at this image:

Hawk - Underexposed

Hawk - As Shot, Underexposed

Basically, I screwed up and underexposed the above image about 1 – 1.5 stops lower than it should have been. Gladly, I shot in RAW and I was able to almost fully recover the otherwise lost details. The below image on the left was recovered from a RAW file (I added +1 Exposure and added +15 Fill Light in Lightroom), while the image on the right was recovered the same way from a JPEG image:

Hawk - Recovered from RAW Hawk - Recovered from JPEG

As you can see, the image on the left contains a lot more color and detail than the one on the right. The change in colors is especially noticeable in shadow areas and this is all due to the fact that the JPEG file is an 8-bit image and contains much less information for full color and detail recovery. If you take an extreme example where an image is underexposed by 2 or more stops, you will see that recovery from a JPEG file is almost impossible, whereas a RAW file will give you some colors and details to work with. And on top of the above underexposure problem, what if I had my white balance set incorrectly on my camera? That’s right, it would have been a trashed image. Try it yourself – set your camera to shoot RAW+JPEG, then underexpose an image and try to recover the details – I’m sure you will see a similar result.

Here is another example of an image that was processed in RAW and JPEG:
Original Image - No Processing

The above image is how it came out of my camera with standard settings.

Processed from RAW Processed from JPEG

And here are the results after some heavy processing in Lightroom. The image on the left is processed from RAW, while the image on the right is processed from JPEG. As you can see, the highlights on the stones in JPEG image look horrible in comparison to RAW – look at how much detail I was able to bring out of shadows from the RAW file. The sky looks too blue and gradiented and the rest of the colors are way off.

Another great example can be seen in an article that compares dynamic range between Nikon and Canon DSLRs. I gave two examples in that article that show what a 14-bit RAW file can do compared to a JPEG file when recovered in post-processing. Take a look at the below images (Left: RAW +5 Stop Recovery, Right: JPEG +5 Stop Recovery):

Nikon D800E +5 EV Nikon D800E JPEG +5 EV

That’s a drastic difference in the ability to recover colors and details!

Anyway, here is my conclusion on the RAW vs JPEG debate: if you are serious about your photography and want to be able to sell or showcase your work in the future, you should shoot in RAW format. If you are just taking pictures of your family for fun, then shoot in JPEG.