The Digital Corner
All rights reserved.
Digital Raw Format
Most consumer digital cameras produce images in JPG format. This JPG format uses a so-called lossy compression which is not the best format if image quality matters (i.e., if you want to print the image and not just use it on the web). Higher end consumer cameras also give the photographer the option to use a lossless TIFF format but with this there is a high price to pay: These files take up a lot of space on the Compact Flash card and it is time consuming to write the image to the card.
Let's use some numbers to show how this works (these numbers are not precise, I am only using them to show the magnitude of what is involved). For a 3 MP (Mega Pixel) camera, a fairly low compression JPG image might be 2MB of size while a TIFF file will be about 7.5MB in size. By selecting a lossless compression option for the TIFF file, we might even get the file size down to about 5MB. In order to do so, we would need more processing power to perform the compression in the camera. This results in a slower write speed to the Compact Flash card.
It is here where the different proprietary RAW formats come into play. These RAW formats provide even more information in a smaller 3-4MB file! Before I explain how this can be true, we need to understand how most photo camera CCDs (or CMOS sensors) see the photo. These sensors are capable of only seeing gray values (Figure 1). The better sensors see them at 12-bit depth, or in 4096 shades of gray. Some new designs, such as the Foveon camera, feature (like high-end video cameras) 3 sensors to capture full RGB images.
How does this translate into an RGB image? "On top of the CCD's array of pixels is fixed a colored filter which has millions of little colored cells, each aligned with a single CCD pixel. In the D1 (and most similar devices), these filters are arranged in alternating rows, every other row with the filter colors (Red, Green, Red, Green, Red…) and the remaining rows as (Green, Blue, Green, Blue, Green…). Green appears twice as often because our eyes are most sensitive to differences in green for the detail in images" (from an article by Daniel Stephens).
At this point, we still don't have a RGB image. To get this, we need to interpolate the RGB value from the information we have on the neighboring pixels (Figure 2). This interpolation, which nearly all of today's digital cameras perform, might seem simple up front but it is not at all simple (i.e., how to resolve details, minimize noise, interpret color, etc).
For JPG and TIFF files, this interpolation is done by the processor chip in the camera and also, to save processing time, it is done for 8 bits of the available 12-bits of color information. In this process, the other 4-bits are discarded unused.
Now we can explain why the RAW file can be so compact and still keep all 12-bits of color information. The RAW file is a dump of the gray scale data that the CCD captures and it is then compressed by a mostly lossless compression scheme. This is what gives us a compact file and even more color information. However, there is no free lunch. The RAW files cannot be directly opened by Photoshop.
What otherwise happened in-camera with JPG and TIFF files, now has to be done by an external RAW conversion program. For the D1/D1x, we have at minimum 3 different commercial programs which can perform this task (Nikon's proprietary program Capture 2, Bibble and Qimage). These are all quite different without a clear winner and never ending updates.
You might be wondering why someone would go through these hassles instead of just using JPG or TIFF file formats. There are three important reasons for this: first, 12-bit color information is only available with RAW files; second, computer-powered external RAW file conversion enables more complex conversion algorithms and third, post-capture processing of contrast, saturation, WB (white balance), sharpening, and exposure give the photographer many more options and tools to work with.