Explaining RAW Files
sduford on Oct 23 2005
Explaining Digital Camera Raw Formats
- What is a RAW file?
- Why would I want to use RAW instead of JPEG?
Those are the types of questions I often get from other amateur photographers and people who are new to digital photography. So I decided to write this short article in an attempt to explain the mysteries and wonders of the RAW format in layman’s terms.
First of all, RAW is not a single format. Since RAW is in effect the raw data coming from the sensor, pretty much every camera manufacturer has one or more distinct raw formats. For example, Nikon uses the .NEF format, while Canon uses .CRW and .CR2 formats, so RAW formats are not compatible with each other but they are all fundamentally the same thing. Adobe is actually pushing a common raw format they call DNG (Digital NeGative) with the hope that it will become an industry standard.
The second thing you must know about RAW formats is that they are not picture formats at all; they are just raw bits of data. That data must be interpreted, processed, and transformed in order to create a picture file that can be viewed or printed. Keep in mind also that every digital camera starts off with RAW data, but most of them convert the data into a JPEG file right in the camera. When you shoot in RAW with your DSLR, you are in fact postponing that transformation until you get the files to your computer. So why would you want that extra complexity? That’s what I will try to explain next.
You can think of the process of taking a RAW file and transforming it into a JPEG picture as being analogous to taking raw food ingredients, then using a recipe to process and combine them into a delicious meal. When you mix the ingredients and cook them, you are permanently transforming them, and many ingredients completely lose their identity. Once the meal is cooked you can still change it a bit and try to fix the flavour, but what you can do at that point is vastly limited compared to the latitude you had with the raw ingredients. Well, the same goes for RAW files: once converted to JPEG, you have lost a lot of information and latitude for modifying or fixing the image.
When your camera produces a JPEG, it takes the RAW data from the sensor and applies a “recipe” to that data. First of all there is a basic interpolation of the data that must happen as each pixel only contains one colour (25% are red, 25% blue, and 50% green). The converter must interpolate the other colours based on the adjacent pixels (a few cameras based on the Foveon sensor actually produce 3 colours per pixel, but the vast majority do not). This process will cause the image to have rather fuzzy edges, which explains why every digital picture must be sharpened. The sharpening process involves increasing the contrast ratio along all edges in the image. The settings that you have selected in your camera like the amount of sharpening, the colour saturation, the tonal curve, and the white balance are also all part of that “recipe” that is used to create the final image.
When you are shooting in RAW, you are basically telling your camera to not process the image, but simply save the sensor data in a raw data file. Those data files also contain metadata that describes how the picture was shot (ISO setting, exposure, white balance, colour space, gamma curve) but those are just tags that describe the data, they do not actually modify the data. For example, when you change the white balance on your camera from “sunny” to “cloudy”, the sensor still sees and captures the exact same data, but the file gets tagged with a different white balance setting. This information is then used by the RAW converter to decide how to interpret and convert the data into an image. So this gives us the first example of why it is better to shoot in RAW: you can change the white balance after having taken the picture!
Another big advantage is that your RAW file contains 12 bits of information per pixel (some cameras use 10 or 14 bit sensors, but the majority are 12 bits). 12 bits gives us 4096 ( 2 to the power of 12 ) possible values of luminosity per pixel. Once the colour information has been interpolated, we have 12 bits per colour channel (Red-Green-Blue or RGB) for a total of 36 bits of information per pixel. In contrast, a JPEG file only contains 8 bits per colour channel, or 256 ( 2 to the power of 8 ) possible values of luminosity per colour channel for a total of 24 bits per pixel, a huge difference. So converting to JPEG removes a lot of the available contrast range in the picture (the difference between the darkest and brightest pixels). So if you need to correct an under or over-exposed picture, or if you need to change the overall contrast of the picture, you are MUCH better off doing it before transforming the file to JPEG. Also keep in mind that JPEG uses a ‘lossy’ compression ratio that discards a lot of image information and introduces some artefacts that can become very obvious at high compression. You could also save your files in TIFF format instead of JPEG. TIFF files support 8 or 16 bit and can be uncompressed or compressed with a loss-less algorythm. TIFF images tend to be very large, so you probably don’t want to use them on a regular basis. A few cameras can save in TIFF, but it is usually the 8 bit flavour, and their size will limit the number of pictures you can put on your card. Yes RAW images are actually smaller then TIFF! However, if you want to send a file to a lab to make one large print with the maximum quality, TIFF will provide the best possible image quality and it is universaly supported.
Another advantage of the RAW file is that the file still contains individual RGB colour channels. This allows you to manipulate each channel separately in order to correct or modify the colour balance of the image. For example, you can also modify the brightness, contrast, and sharpness of each individual channel. Sharpening is also a lot more efficient on the RAW data, as sharpening a JPEG file tends to exacerbate JPEG’s compression artefacts. There are a lot of other advanced editing techniques that are available to you or you software tools when working with the RAW data, but I do not have the time or space to cover them all here. Finally, you should know that when you modify a RAW file with your conversion software you never affect the raw data itself: you are only changing the metadata, or the recipe used to convert the file.
Now, this might all sound very complicated, but keep in mind that just as your camera can do the conversion for you automatically and with only a few options, so can your conversion software. So whether you are using Adobe Camera RAW, Nikon Capture, or any other tool, you can still just set a few things like ‘medium’ sharpening and ‘cloudy’ colour balance, and let the software rip. You can even convert all your files at once in batch mode. Personally I like to use DXO Optics Pro which also corrects for chromatic aberrations and lens distortions based on the metadata that describes how the shot was taken. This is my first pass to convert all my pictures to JPEG and inspect them. If I find a picture that is really interesting or needs more advanced corrections, I can then go back to the RAW file and manually process it in Adobe Photoshop. So if your camera can shoot in RAW I highly recommend you give it a try. Once you understand the basics (hopefully I managed to explain them properly here), then it doesn’t have to be any more complicated then shooting in JPEG.
Happy shooting!
Sylvain Duford

Sylvian,
I’ve wanted to take up digital photography for quite some time now and although most seems to be relatively straight forward, there are a few issues I have. One of them is the uncertainty about RAW, however you explanation has made it all absolutely crystal clear. Thank you.
I wonder if you could possibly advise me. I have been doing quite a bit of research over the summer and every time I think I have found the right camera, I wait for it to come down in price and then a new one comes out, and then I am back to square one!!
I originally had my eye on the Nikon D40 then D40x which was very nearly purchased, and now I am unable to choose between the D80 or Canon’s EOS 40D or push the boat out for the D300 when it becomes available.
I basically don’t mind spending £700-£900 as long as it stays with me for many years.
Many thanks,
Niel Stradling
Hi Neil, glad my little article was useful for you!
My personal assessment of the three cameras you are looking, keeping in mind I have not yet got my hands on a D300, would be as follows:
1- D300
2- 40D
3- D80
It so happens that this is also how they rank in terms of expensiveness. I think all three are great cameras, and all three are excellent value, but the D80 is particularly good for the money. It really depends on what you are looking for in terms of features.
Since you are a beginner at digital photography, I would recommend you go with the D80 and spend the extra money on good glass. A good lens will have more impact on your pictures than any differences between those 3 great cameras plus they will likely last a lifetime.
Also, since the technology is still advancing at an incredible pace, you are very likely to want to upgrade in a year or two because of some new model which has some must-have features. By that point you will know what you like and don’t like, and what features are important to you.
You might want to check my forum at digitalfotographer.com for more help on choosing the right camera for you.
Good luck!