Dave Kilbey Training and Consultancy


Why Use Raw Files?

All modern digital SLR cameras and an increasing number of compact cameras are equipped to shoot raw files in addition to JPEGs. This article examines the pros and cons of using the raw format.


A Bit of Background

All camera manufacturers have their own raw file format; Nikon call theirs .NEF, Canon use the extension .CR2 and Olympus utilise .ORF. But not all raw files, even those with the same extension, are the same. With each new camera body released onto the market comes a revised raw format. Therefore, the code for a Canon 20D raw file is different to that for a 30D raw file, which is different again to that for a 40D.


Key point

Raw file formats are proprietary. The code is owned by and unique to the camera manufacturer. This presents certain problems which we will look at in the "The drawbacks" section. However, let’s focus first on the positives.


Benefits of Raw

In simple terms, raw files record more information than JPEG's. The JPEG format is a 24-bit file format. It records information in three colour channels: red, green and blue, each of which records 8-bits of information (256 tones/colours). This gives a JPEG the capacity to record approximately 16.8 million tones/colours. This is certainly enough to reproduce full-colour photographic images well.

Raw files, while still recording information in three channels, record between 12 and 14 bits of information per channel depending on which camera you are using. This means that raw files can capture 4096 or 16384 tones per channel, respectively. In total, this means that a raw file can record either 68.7 billion or 4.4 trillion tones respectively.


Why so Many Tones?

In the world of digital imaging bigger isn't always better. With greater bit depths come larger files sizes - all other factors remaining constant. This obviously has implications for storage and processing demands for your computer and camera.

However, having more information in the first place enables us to sacrifice some data (for example, by editing the image) without significantly altering the overall quality of the file for the majority of uses. Put a JPEG through a rigorous process of editing procedures and chances are that some cracks will start to appear if we look at the image data. Put a higher bit depth file put through the same procedure and it will shrug it off as if nothing has happened. As a percentage, the bit stream will be less compromised even if, on the surface, the files look identical.

Dave Kilbey - Comparisson of 24 and 48 bit file

....A closer look at the data loss (missing levels) caused by editing in the 24-bit version

Dave Kilbey - Levels showing combing due to data loss

More important than simply the higher bit depth is the way the information is recorded in raw. Unlike a JPEG, TIFF or PNG file a raw file is not a pixel-based image format. Raw files, often likened to digital negatives, record data in a different, less processed fashion - hence the name.


Key point

Raw files record information very differently to pixel based file formats making them more flexible.


Going Deeper

If you were to look at a camera sensor under the microscope you would see that it is essentially a wafer thin silicon microchip covered with light-sensitive sites or cells. Each cell relates to a pixel in your final digital image. These cells measure the number of photons of light hitting them when the camera shutter is opened. A dark subject reflects less photons than a bright one. Each photon recorded by a photocell generates an electric charge. The more photons recorded the higher the voltage. Raw files, therefore, record tiny voltages, millions of them, representing the luminosity values of a subject.


OK, Raw Files Record Electric Charges/Luminance Values. Why is that Important?

Well, because a raw file essentially records luminance values (i.e. how dark or bright an area of a scene is) specific information relating to colour isn't irreversibly written into the file at this stage. Instead, it is recorded separately and incorporated/interpreted later on using a raw file converter programme on your computer system. Other camera settings are also recorded in this way such as white balance. Having this data held separately gives us a great deal of flexibility not present with other file formats.


Raw File Conversion

A “regular” image editing application is designed to deal with pixel-based and/or vector images. A raw file doesn’t conform to either of these image types meaning that a raw file converter (a program that can interpret and process raw information into a meaningful output) is required.

The camera you purchase will ship with a proprietary program designed to interpret your camera's raw files. If you wish to use Photoshop or another third-party image editor then you'll generally need a raw converter plug-in. These are usually available as a free download.

Because raw images do not consist of fixed pixel values you have a great deal of freedom to edit the file. What's more, these edits are non-destructive, meaning that your image data is not degraded in any way. As an example, the white balance value recorded at the point of capture can be replaced by another one with no resulting data loss in the file - the captured luminance values are effectively passed through a different filter when a pixel based file is created from your raw image. Similarly, you can alter saturation values, remove sensor dust spots, adjust exposure and recover blown highlights (so long as there is information in at least one of the colour channels) - all of this without damaging the file data since no information has yet been committed to pixels.

It should be noted however, that raw files are not a miracle cure. If an image hasn’t been exposed correctly at the point of capture the margin for correcting error is still narrow. Underexposed images will not contain sufficient information in the shadows and so increasing exposure post capture will invariably result in noise becoming more apparent. At the other end of the spectrum, blown highlights can only be recovered if tonal information has been captured in at least one of the colour channels. If the information isn’t there in the first place even a raw file can’t help.

In effect, for well captured images the bulk of a photographer’s optimisation processes can be achieved non-destructively with a raw file.  Once the basics are sorted the file can be exported as a standard pixel-based file (at which point most editing then becomes destructive) for fine tuning in your preferred image editor.

Another major inherent advantage of raw is that any edits you choose to make to the file are not permanent.  You can quickly reset the file to its original values and create another interpretation of the data.  Edits are recorded in a file held alongside the original image data meaning that you can simply step back through the changes you applied - much like you would if you use the History feature in Photoshop.


Key Point

Raw files can be edited “non-destructively” allowing features like white balance, saturation and, to some extent, tonal range to be altered as if at the point of capture.



The Drawbacks

Having looked at some of the advantages of raw it is worth considering some of the possible drawbacks.  When shooting images on modern SLRs you essentially have two choices - shoot JPEG or raw.  So let's tease out the potential negatives of raw compared to JPEG.

  1. Shooting raw rather than JPEG is slower (raw files are considerably larger so frames per second rates are slower and less files can be buffered).
  2. Raw files take up more space than JPEGs on your memory cards/hard drives.
  3. Raw files require a raw converter and need further work to make them widely usable after being downloaded.
  4. Processing raw files will mean spending some time learning how your raw converter works.
  5. You can't write metadata into a proprietary raw file using a third-party image editor/asset management system (but see section on DNGs as these are an exception)
  6. The fact that raw formats are proprietary means that they are not archivally sound formats (if the manufacturer goes bust, support for the format might disappear). This happened when Minolta went bust.

The DNG format

Due to the longevity concerns associated with proprietary raw formats Adobe devised an openly documented raw format called DNG (short for Digital NeGative). You can easily convert your proprietary raw files to DNG, which is natively supported by Adobe programs such as Photoshop and Lightroom. A raw file converted into DNG has all the same properties of a proprietary raw file. Because it is "open" DNG presents a more secure option for long-term storage.

For the less certain DNG user, the option exists to convert your raw files in to DNG but also package up the original raw files within it.  This adds considerably to the size of the file but does cover all angles.

Another distinct advantage with DNG is that it enables you to embed your metadata directly into the file header itself.  This avoids the need for a separate XMP "sidecar" file which is created if you add metadata to proprietary raw files.  Having a separate metadata file increases your file management burden and presents the lingering danger of the sidecar file becoming orphaned (or disassociated) from the original image if/when you move the original.  Also, it is less easy to cascade metadata down into surrogate images if the metadata is held in a separate file.


Key points

DNG is an "open" format meaning that it is a safer bet for long term storage. It has all the same benefits of proprietary raw formats. In addition, metadata can be written directly into the file.


Conclusions

Overall, for those wanting to capture and preserve the most information possible in their image files raw is undoubtedly the best choice.  Raw also offers a greater degree of flexibility allowing photographers and image editors to capitalise on the format’s more fluid nature so that edits are non-destructive.

On the flipside the proprietary nature of raw files necessitates the use of a raw converter and raises serious questions about longevity of support.  However, converting to the DNG format is straightforward and means that your raw files will be supported natively in many editing/asset management applications whilst offering a genuine choice for archiving your valuable assets.  It should be taken into consideration that the processing overheads of raw files are greater than JPEG both in-camera and once downloaded.  This is principally due to larger file sizes but also because you will be required to do a little extra work on your computer in order to get the best from using this format.