RAW Vs. JPEG - Understanding Camera File Formats

Understanding Different Camera File Formats

Advanced cameras tend to offer both RAW and JPEG image recording, while beginner level cameras tend to only offer JPEG. Topic Images Inc. / Getty Images

It seems as if more contradictory information about RAW vs. JPEG camera file formats exists than with any other digital photography topic. The arguments for shooting in RAW format versus JPEG seem to be never ending at times, with everyone having their own opinion as to which format is better. The truth is that, although RAW files are undoubtedly superior in image quality, both formats have their place.

Learn how to decide the debate here!

What is RAW?

A RAW file format is essentially the uncompressed, unprocessed data file captured by your digital camera's image sensor, with minimal in-camera processing applied. It is the digital equivalent of an exposed but unprocessed film negative.

When you take a digital photograph, the image sensor chip inside your camera (known as a CCD or CMOS chip) simply records the amount of light that has hit each pixel. Your camera records either 12 or 14 bits of data at this stage, depending on the model. If you shot your image in RAW mode, and later converted it into a TIFF or .PSD file, then you can export it in 16-bit mode. This allows the 12 or 14 bits recorded by the camera to be spread across the whole 16-bit workspace. A JPEG, in comparison, is converted by the camera's software to 8-bit mode.

Pro photographers tend to utilize RAW as an option to ensure the camera does not perform any in-camera processing to their images, as they prefer to do that themselves in post production.

Saving a RAW File

When you save a RAW file, you'll see that your image has metadata attached to it. This is essentially a file that contains all of the camera settings, such as sharpening level, color temperature, and white balance. Your camera creates a header file for this information, which the camera tags onto the RAW image data.

At no point do these settings change your image. The camera then saves this entire combined file onto your memory card

The image editing software reads -- but does not change -- the RAW file's metadata, then displays the image. At this point, you can manually adjust the settings using your software.

Saving a JPEG File

When you save a JPEG file, all the information that a RAW file would keep separately in a header file is saved as part of the JPEG file (and is therefore unchangeable using image editing software).

The camera applies the JPEG settings automatically, and, in some cases, its settings are limited. For instance, cameras usually only have between one and three sharpening settings, such as "unsharp masking," where the camera finds the edges between light and dark areas and enhances the contrast. With limited sharpening abilities, high levels of sharpening can produce visible halos around these edges. Consequently, if the levels are set too low then the sharpening may prove insufficient.

You also have to remember that, by itself, no sensor can record color. Most imaging chips use what is called a Bayer Matrix or a Color Filter Array in order to record color. In layman's terms, this means that red, green, and blue filters are placed over each pixel and, through a very complex algorithm, comparisons between the values recorded by each pixel and its neighbors derive the color information.

The problems arise as, when saving a JPEG, the camera converts the file from a higher data quality (12- or 14-bit mode) to a lower one (8-bit mode). Eight-bit mode only allows the camera to capture 256 shades of color per pixel (compared to RAW's ability to capture 4,096 shades). Suddenly, a huge amount of potential color information is lost.

On top of this, the JPEG file format applies compression to images, so as to create smaller file sizes, but which inevitably means discarding some data. If compression can be set to a low level (such as 2:1), very little data will be lost. At higher compression levels, though, the data loss may be obvious.

So Why Would You Ever Shoot JPEG?

JPEG's primary advantage is that the compression creates smaller files, which means you can save more of them onto a memory card. Transmitting these small files online is easier, too, which is important for many amateur photographers. You also need a huge buffering zone in the camera to shoot RAW files continuously and quickly, whereas JPEG allows you to fire your camera rapidly.

Most importantly for amateurs, you don't have to post-process all your files with JPEG. (Believe me, processing RAW files can take a long time.) And it's easier to share JPEG files with others, as nearly any electronic display device can show JPEG files. You may need special software to view RAW files.

Final Word

RAW files not only capture more data in the first place, they also allow conversions on a more sophisticated platform. By then saving the converted files as TIFFs, full image quality is preserved. With a JPEG file, you are committing yourself at the time of exposure to several of the most important aspects of image quality (such as white balance, overall contrast, and color saturation). Because of this, it's important to keep these aspects within a limited range, or the deterioration of image quality will be easily visible.

If you're looking for the best possible image quality, then, obviously, shooting RAW is the answer. For most situations, though, shooting JPEG is perfectly adequate. Are you going to see any loss of quality with JPEG if you're just shooting snapshots for the family album? Not really, and, in fact, you'd need to start printing at at least A4 sizes before you'd notice even the slightest deterioration from JPEG.

In the RAW vs. JPEG debate, both formats have their place.