Deconstructing RAW – Part I


Links in this post may be to our affiliates; sales through affiliate links may benefit this site. Please help support this website by patronizing Amazon. It won’t cost you anything extra.

What is RAW, how is it used and why should you use it? These are questions I will try to address in this article, beginning with the question: What is a raw file?

A modern day sensor is patterned like this:

Each pixel only passes through one color, like this:

However, an image needs three colors per pixel, like this:

An image in which each pixel has all three colors defined is called a raster image or bitmap. Such an image is written into a file one pixel at a time, with each pixel having three values for Red, Green and Blue:

On the other hand, the data coming out of a sensor will have only one color per pixel. This data, when written into a file, is called a RAW file. This data is usually ‘treated’ by sophisticated algorithms to cook up a raster RGB image. Many cameras, however, also offers the raw file directly to the end user, who can then use third party programs or algorithms to cook up their own versions of a raster RGB image.

A typical raw file created from a bayer sensor will be one-thirds the size of a full raster image of the same resolution. E.g., as we saw here, an uncompressed 2432×1366 12-bit raster file will be around 15 MB. A raw file for the same resolution should be about 5 MB – this is the size of a 12-bit CinemaDNG file from the Blackmagic Cinema Camera.

Don’t forget that different file formats have different metadata requirements and structures, and this additional data will cause a 5% to 10% variance – but usually no more. Some forms of metadata are:

  • Header information
  • EXIF information from the camera
  • Miscellaneous information from the camera
  • Proprietary information
  • Thumbnails or compressed images
  • Metadata of metadata!

If another kind of sensor is used, like the Foveon sensor used in the Sigma SD1, with 12-bit lossless RAW, the raster image should be 63.3 MB, and the raw file should be the same size. However, in practice, the raw file is approximately 45 MB, or 30% less. It is likely that the raw file is already a processed version of the raw data.

What is this ‘processing’ that must be done to a raw file? In layman’s terms, we can call this processing demosaicing – even though for sensors like Foveon there is no mosaic to demosaic.

No matter what the sensor type, demosaicing must always be performed on the raw data to get an RGB raster image. The algorithm, software or hardware that does this is usually called a Raw converter.

There is a lot of misinformation going about the internet, about raw being an ideal format. But even my simple description should have pointed out one important fact – even raw files can be ‘cooked’. Just because your file is raw doesn’t mean you have access to pristine information from the sensor. Very few camera manufacturers give you unbiased access to sensor data.

Another fact to note is that a sensor performs an analog to digital (ADC) conversion. If you’ve read Driving Miss Digital, you will have learnt that this process can also be fudged to misinform consumers. This is especially true when some manufacturers claim 14-bit or 16-bit processing in their cameras – don’t be fooled by such claims. One should always investigate for themselves on what is truly being offered in a raw file.

In the next part I will take a look at how certain manufacturers use RAW files.

2 replies on “Deconstructing RAW – Part I”

  1. Thank you! Very helpful. I have a GH4 and a7s, and I always want to get my hands on a Black Magic Cinema camera that shoots RAW.

  2. Pingback: How to Work with Redcode RAW R3D Footage | roberto cimatti

Comments are closed.