Fundamentally, a digital raw file is a record of the raw sensor data from the camera, accompanied by some camera-generated metadata (literally, data about data). I'll discuss metadata in great detail in Chapter 8, Mastering Metadata, but for now, all you need to know is that the camera metadata supplies information about the way the image was captured, including ISO setting, shutter speed and aperture value, white balance setting, and so on.
Different camera vendors may encode the raw data in different ways, apply various compression strategies, and in some cases even apply encryption, so it's important to realize that "digital camera raw" isn't a single file format. Rather, it's a catch-all term that encompasses Canon .CRW and CR2, Minolta .MRW, Nikon .NEF, Olympus .ORF, and all the other raw formats on the ever-growing list that's readable by Adobe Camera Raw. But all the various flavors of raw files share the same basic properties and offer the same basic advantages. To understand these, you need to know a little something about how digital cameras work.
The Camera Sensor
A raw file is a record of the sensor data, so let's look at what the sensor in a digital camera actually captures. A number of different technologies get lumped into the category of "digital camera," but virtually all the cameras supported by the Camera Raw plug-in are of the type known as "mosaic sensor" or "color filter array" cameras ("virtually all" because versions 2.2 and later of Camera Raw also support the Sigma cameras based on Foveon's X3 technologysee "The Foveon X3 Difference," later in this chapter). The first key point is that striped-array raw files are grayscale!
Color filter array cameras use a two-dimensional area array to collect the photons that are recorded in the image. The array is made up of rows and columns of photosensitive detectorstypically using either CCD (charge-coupled device) or CMOS (complementary metal oxide semiconductor) technologyto form the image. In a typical setup, each element of the array contributes one pixel to the final image (see Figure 1-1).
Figure 1-1. An area array
Each photosensor contributes one pixel to the image.
But the sensors in the array, whether CCD or CMOS, just count photonsthey produce a charge proportional to the amount of light they receivewithout recording any color information. The color information is produced by color filters that are applied over the individual elements in the array in a process known as "striping"hence the term "striped array." Most cameras use a Bayer pattern arrangement for the color filter array, alternating green, red, green, blue filters on each consecutive element, with twice as many green as red and blue filters (because our eyes are most sensitive in the green region). See Figure 1-2.
Figure 1-2. Bayer pattern
In a Bayer Pattern color filter array, each photosensor is filtered so that it captures only a single color of light: red, green, or blue. Twice as many green filters are used as red or blue because our eyes are most sensitive to green light.
Other color filter array configurations are possiblesome cameras use a cyan, magenta, yellow arrangement instead of the GRGB configuration in the classic Bayer pattern, while still others may use four colors in an attempt to improve color fidelity. But unless you plan on designing your own cameras, you needn't worry about the details of this or that filter setup.
Raw Files Are Grayscale
No matter what the filter arrangement, the raw file simply records the luminance value for each pixel, so the raw file is a grayscale image. It contains color informationthe characteristics of the color filter array are recorded, so raw converters know whether a given pixel in the raw file represents red, green, or blue luminance (or whatever colors the specific camera's filter array uses)but it doesn't contain anything humans can interpret as color.
Obtaining a color image from the raw file is the job of a raw converter such as Camera Raw. The raw converter interpolates the missing color information for each pixel from its neighbors, a process called demosaicing, but it does much more, too. Besides interpolating the missing color information, raw converters control all of the following.
All raw converters perform each of these tasks, but each one may use different algorithms to do so, which is why the same image can appear quite different when processed through different raw converters.