Gigapixel AI
Sharpen AI
DeNoise AI
Video Enhance AI

RAW vs JPEG photos: Understanding the benefits and differences

Brian Matiash
September 20, 2021
Time to read:

Understanding the difference between RAW and JPEG photos

A growing list of terminology has made its way into today's digital photography zeitgeist. You likely hear or read words like uncompressed, lossy, and non-destructive and see statements extolling the importance of using the most optimal camera settings all the time.

Of all these tidbits thrown at photographers, the file formats you use when taking digital photos are one of the most commonly discussed and are essential to understand. You've probably been told that you must shoot in RAW if you want to get the best quality out of your photos, and while that statement is valid, you should also have a clear understanding of what makes it accurate. It's also important to understand the benefits and limitations of both RAW files and JPEG files, arguably the most used and compatible image file format available.

My "new camera" ritual

I have a special ritual I follow whenever I buy a new camera. After carefully inspecting the dials, buttons, and displays, I begin a systematic journey to examine each of its settings. Without fail, the first one I change is the file format. The typical default setting that camera manufacturers ship their cameras with is JPEG, and I'll explain why later on, so my first order of business is to change it to RAW. I even recorded this video walkthrough of how I set up a new camera. You’ll see that I spend a good chunk of time explaining the RAW setting I use and why I prefer it. And while I filmed this video in 2016 using a now-dated Sony a7R II, the RAW settings I discuss are just as relevant today.

Historically, photographers would have to think twice about selecting RAW because its larger file size would quickly fill up removable media cards. Thankfully, the price of removable media cards has dropped significantly while maximum capacity has rapidly increased over the years. Now, I don't think twice about space limitations resulting from shooting RAW, especially considering that the cameras I use have two card slots, effectively doubling my total storage capacity.

So, yes, most photographers would agree that it's essential to shoot RAW, but I suspect that far fewer of them understand the myriad reasons why it's beneficial. I will shed light on the benefits and limitations of RAW and compare it to the JPEG format because it has several merits worth considering. But first, it’s worth defining both file formats.

Comparing RAW and JPEG editing workflows.

I’ll cover a lot of topics related to the benefits and differences of RAW and JPEG files in this article. However, it’s also important to see the material impact that a RAW file has during post-processing, especially when compared to a JPEG file. I recorded this video to provide a much clearer understanding of what it means to have access to a RAW file’s added dynamic range and color information.

What is a RAW file?

That is a straightforward question with many potentially complex answers. Whenever you press your camera's shutter button, the light that hits the sensor translates into digital data. When you set your camera to shoot RAW, that sensor data is saved as it is recorded with minimal to no additional processing. Some cameras may save a compressed RAW file, but most higher-end cameras give you the option to save uncompressed versions. These files are generally referred to as RAW files because they contain the raw sensor data from the exposure. RAW files have larger file sizes than their JPEG equivalents because they retain all the available sensor data. The screenshot below shows the file size info of a RAW file and the corresponding full-resolution JPEG file. The RAW file size is about 5.5x larger than the JPEG.

The primary benefit of having access to this sensor data is more flexibility with tonal and color adjustments. RAW files also support "non-destructive" photo editing processes. In other words, you can never permanently change the contents of a RAW file no matter how many edits you make. I'll discuss the benefits and limitations of non-destructive RAW photo editing workflows later in this article.

The components of a RAW file.

© Brian Matiash

Did you know that each RAW file is greater than the sum of its parts? It's true! We generally refer to a RAW file as a singular item, but three components make up each one:

1. The RAW file contains all the sensor data and camera metadata created when your camera completes an exposure. Each camera manufacturer has its proprietary file format. For example, Canon uses the .CR2 and .CR3 file formats, Sony uses the .ARW file format, and Nikon uses the .NEF file format. This RAW file is never touched during the editing process, hence the term “non-destructive.”

2. The associated "sidecar" file created alongside every edited RAW file stores changes made in applications like Adobe Lightroom and Capture One. That is why editing RAW files are non-destructive; Every editing step you take is stored in the sidecar file and never gets written to the RAW file. When sharing a processed RAW photo, you need to provide both the RAW file and its respective sidecar file to preserve your edits. The alternative is to convert the photo to a more compatible RAW format such as DNG or into a JPEG, thereby destructively baking in all edits made into a compressed, lossy file.

Here’s a snippet of a sidecar file that was created alongside one of my RAW files. There’s a lot more information in here, but I want you to get an idea of the sort of metadata is stored alongside each edited RAW file.

3. The auto-generated JPEG preview is embedded within every RAW file. Did you know that when you press the preview button on your camera to review a photo you took, the camera displays a JPEG preview that is generated automatically and embedded within the RAW file? That is why you may notice dramatic differences in contrast and color between the camera preview and the RAW file. I'll discuss this later, but to summarize, JPEG files are processed and compressed in advance, making it easier and faster for cameras to display when previewing photos you've taken.

Where does the DNG file fit in when discussing RAW files?

Adobe developed the open-source DNG format, and it is a RAW file for all intents and purposes. The best way to think of a DNG file is that it is a wrapper containing both the actual RAW image data and the editing information typically stored in the associated sidecar file. And did you know that there are two types of DNG files? The first type is called a color filter array (CFA) DNG. This type of DNG is most similar to traditional RAW files because they contain the same raw image sensor data. Several camera manufacturers like ZEISS, Leica, and Pentax have opted to use the CFA DNG format for their RAW image pipeline, easing the burden of managing proprietary file formats. The second type is called a Linear DNG. This type of DNG offers a lot of the same benefits as the CFA DNG, but it is partially processed.

You may have heard or read about photographers who adopted a workflow of converting all of their RAW files to the DNG format, and there are several common reasons why some choose to do so. Many photographers prefer the DNG format because it stores all edits within a single file, so you only have to share one file instead of two (the RAW file and the sidecar file). DNG files also tend to have smaller file sizes, although that can vary if you embed the full resolution, uncompressed RAW file.

Perhaps the most common reason photographers adopt the DNG file workflow is that they don't want to worry about using software capable of viewing proprietary RAW file formats. One of the most significant limitations with converting to DNG is that some critical camera-specific metadata can get stripped in the process. That is the primary reason why I do not convert my RAW files to DNG.

What is a JPEG file?

© Brian Matiash

The best analogy I can make is to compare a JPEG file to a Swiss Army Knife. Both are widely available, universally recognized, and exceptionally handy. When you think about it, we're pretty fortunate that the JPEG file format exists. You never have to worry about whether the photo you took with your six-year-old smartphone or two-week-old camera will correctly display when shared, thanks to the JPEG file format. Can you imagine the compatibility issues we'd run into if every display manufacturer and web browser developer had to update their products to support every camera manufacturer’s proprietary RAW file format?

Lossy compression algorithms are used to create JPEG files, and this is an iterative process. In other words, every time you save a new JPEG file, some bits of data are either compressed or lost. The primary benefit to the lossy compression algorithm used to create JPEG files is that the file size is often much smaller than RAW files. Additionally, saving a JPEG file with new edits is considered destructive. When you share a JPEG file, the recipient cannot revise or undo any edits made. Similarly, if you set your camera to shoot in JPEG and you use a built-in creative profile, the color and tone processing applied is permanently baked into the file.

The upsides and downsides of RAW and JPEG files.

Now that we understand what RAW files and JPEG files are, we can evaluate their pros and cons. As I wrote earlier, I always set my camera to shoot in RAW. I prefer avoiding making blanket statements, but this scenario warrants it. The benefits that shooting in RAW offers far outweigh any of the limitations. Let's look at three of the most compelling differentiators.

1. Vastly superior color and tone information
Each RAW file contains all the data captured by the camera sensor and is saved without using lossy compression algorithms. All of this sensor data affords you far more leverage to recover highlight and shadow details, correct white balance, and accurately edit colors. A RAW file also has a much wider dynamic range than a JPEG file, which is especially important when photographing in challenging lighting conditions.

However, you are required to use a raw processor such as Adobe Lightroom to edit the color and tone of RAW files. While that isn't typically an issue, early adopters who buy the latest cameras sometimes have to wait several weeks or months for the developer to add support for those new models, allowing them to view and process those RAW files.

2. Greater tonal value for color depth
Your mouth may form the word "Whoa" when you learn that an 8-bit JPEG file contains a little over 16 million colors. That certainly sounds like a lot of colors. However, it pales in comparison to what 12-bit and 14-bit RAW files offer. A 12-bit RAW file has almost 69 billion colors, and a 14-bit RAW file has approximately 4.4 trillion colors. Suddenly, a maximum of 16 million colors doesn't sound as significant.

Still, those extra colors do come with a cost. 12-bit and 14-bit RAW files have much larger file sizes compared to JPEG files. Although, that may not be a factor now that hard drive and SSD storage are more affordable than ever before.

Greg Benz wrote a great article on PetaPixel explaining what bit depth is and how it affects the quality of RAW files. He also included a very handy graphic illustrating bit depth in black and white.

© Greg Benz

Do you notice the diminishing returns between 10-bits and 14-bits? I can hardly see a difference on my display. Remember that, while your RAW file may be 14-bit, most monitors will not display that full color depth. For example, my BenQ 32” studio editing monitor uses a 10-bit IPS panel.

3. More forgiving, non-destructive workflows
Every edit you make to a RAW file is stored in a sidecar file. As a result, you can always make changes and not worry about losing that information. When I published my first photography book in 2015, I delivered a vast library of edited photos to supplement the text I wrote. The publisher had to review each one to ensure that it'd look good when printed, and I'd often get a list of revisions I had to make. Fortunately, I was able to quickly and non-destructively make those edits thanks to shooting in RAW. In some cases, the publisher made the necessary edits because I provided them with the RAW and sidecar files, so they had access to the complete history of edits I had made. With that said, there is no denying that sharing a JPEG file is a lot more convenient because you only need to send a single file, and it has a much smaller file size.

What roles do RAW and JPEG files play for you?

You should now understand what RAW and JPEG files are, how they differ, and what some of the most impactful benefits and limitations are for each. I mentioned that I always set my camera to shoot in RAW. That's because I want to access all of the color and tone information recorded by my camera sensor during post-processing. While there is some added friction requiring you to use a raw processor to edit your files, the benefits you get are far more important than the convenience of editing JPEG files.

© Brian Matiash

But, that very convenience makes JPEG files a mainstay in virtually every photographer's workflow. The smaller JPEG file size makes sharing much easier, whether via a direct message or on social media. You also never have to worry about display compatibility issues because it is a global industry standard.

I hope this article provides clarity and helps you decide which file formats will suit your needs. Please leave a comment below with any additional questions.

No items found.
Brian Matiash

Brian Matiash is a South Florida photo educator who serves enthusiast photographers looking to grow their landscape, travel, and wildlife skills. Learn more on his website and YouTube.