Virtually all cameras will have a menu option that lets you choose the quality and size that images are saved at. On most higher end cameras (DSLRs, MILCs, and some Bridge cameras), along with various JPEG options, they will also have an option to save in RAW.
RAW is an image format that records the data from the camera sensor, and doesn't apply any manipulation (or only applies a minimal amount of manipulation) to this data. The camera also saves the sharpening, saturation, etc settings in the file, but does not apply them.
You then use a RAW conversion program on your computer to convert the RAW into a JPEG or TIFF file. As part of the RAW conversion process, you can use the settings saved in the file, or you can change the settings.
JPEG meanwhile, has all the sharpening, saturation, etc. settings applied in camera, which means you can't easily change or undo these settings later.
This is the basic process that happens when you take a photo with JPEG vs. RAW:
Light hits camera sensor > Analog to Digital conversion > Sharpening, Saturation, White balance etc. settings applied > Compressed to 8 bit color space > Saved as JPEG
Light hits camera sensor > Analog to Digital conversion > Sharpening, Saturation, White balance etc. settings recorded (but not applied) > Saved as RAW
Settings not 'baked in'
So RAW files are much more flexible than JPEG files. If you have set the sharpening setting too high on your camera, with a JPEG file there is not a lot you can do. With a RAW file, the underlaying data has not had any sharpening applied, so you just set the amount of sharpening you want when converting it to a JPEG.
The same thing is true with any other camera setting: white balance, saturation, contrast, noise reduction etc. JPEG has these settings 'baked in', while RAW format will allow you to change them at the time of conversion.
8bit vs. 14bit
The 'bits' referred to here, are how many levels of tone are recorded in each color channel (R,G,B) of an image. 8 bit means that each color channel has 256 different levels of tone that can be recorded. All JPEG files are 8 bits per channel.
RAW files meanwhile, usually record in 12 or 14 bits per channel. 12 bits is 4,096 tones, while 14 bit is 16,384 tones. So the higher the bits per channel, the more tones it can record, and the smoother gradations will be.
Most monitors are 8 bit (some LCDs are 6 bit), so you are unlikely to notice any difference between an 8 bit JPEG and 14 bit RAW on your screen. Where it does come into play though, is if you want to do any manipulation to your image.
If you perform an adjustment that modifies the tones values e.g. a curves or levels adjustment, in an 8 bit image you will see gaps appear as the tones are shifted.
I saved a 12 bit RAW file as 8 bit and 16 bit TIFFs. (Saving as 16 bit doesn't magically create more data - it only contains the actual data of the 12 bit file). Then I applied the same very strong contrast tone curve to both images. You can see the histograms of the images above, the 8 bits per channel file has lots of gaps in the data where tones have been compressed together, but the 16 bit file does not.
In real life, you will need to be applying some quite extreme adjustments to see any difference. But it is always worth having that extra data there, just in case you do need it.
RAW files allow you to pull back the exposure or use highlight recovery when converting the file. This means you can recover detail from blown highlights that would just be recorded as pure white in a JPEG file. See this post for more information and an example: Why Use RAW Image Format?.
JPEG files are compressed, while RAW files are not. A small amount of information is lost as part of this compression process. RAW files are not compressed (some cameras offer losslessly compressed RAW), so you do not loose any image detail as part of compression.
Of course, this fact means that RAW files are usually much larger (in MB) than JPEG files. This means that they take longer for the camera to record to the memory card. So you cannot normally shoot as many shots in a single continuous burst using RAW format as you can using JPEG format.
It also means that your memory card will fill up much quicker, and RAW files will take up more space on your hard drive. With the cost of memory cards and hard drives, this is not an issue for most people though.
As RAW convertor software improves, you may be able to re-process older RAW files, and get a better result than you could originally. This is not something that you can do with a JPEG, which is stuck with the in-camera RAW conversion from when you took the photo.
In theory, the much more powerful processor that a computer has should be able to perform a better job at RAW conversion than the camera can today as well. However, I have not seen any evidence that this is true.
Different RAW formats
Different camera manufacturers use different file extensions for their RAW formats:
- Nikon: .NEF, .NRW
- Canon: .CR2, .CRW
- Sony: .SRF, .SR2, .ARW
- Pentax: .PEF, .PTX
- Fuji: .RAF
- Panasonic: .RW2 .RAW
- Olympus: .ORF
- Sigma: .X3F
- Samsung: .SRW
- Adobe: .DNG
The .DNG format created by Adobe is an 'open' format, and some camera manufacturers also allow you to save RAW files in DNG format, as well as their own proprietary format.
Although camera manufacturers usually keep the same file extension for RAW files between one camera model and the next, the format that each new camera saves the data in this file tends to have some differences. Often when a new camera model is released, there is a period of time before a RAW converters are updated to support the RAW format saved by the new model.
So, if you get a new (just released) camera, ensure that the RAW conversion software you use supports the camera before you shoot RAW. Or just shoot RAW + JPEG. Then you have the JPEG files for immediate use, and the RAWs for when the RAW conversion software is updated.
A potential problem with this habit of changing the RAW format for every new camera, is that in the future, it is possible that RAW convertors will stop supporting older formats. This would leave you with a load of RAW files you can't do anything with. As far as I'm aware this has not happened so far - RAW files from the 1999 Nikon D1 can still be opened in Adobe Camera RAW today.
This potential problem is part of the reasoning behind Adobe's DNG format. As well as some cameras allowing you to save files directly in DNG format, Adobe also offer a convertor to convert other RAW formats to DNG.
There are a large range of different RAW conversion programs. The most popular are:
- Adobe Camera RAW / Adobe Lightroom (both use the same RAW conversion engine)
- Capture One Pro
- Apple Aperture
- Capture NX (Nikon only)
- Digital Photo Professional (Canon only)
Typically, RAW conversion software produced by the manufacturer of your camera will convert a RAW file (with no adjustments made) so that it looks exactly the same as if you shot a JPEG in camera.
Other RAW conversion software though, will usually give the image a slightly different look. This is because the camera manufacturers do not normally release the precise information on the settings recorded in a RAW file and how they should be interpreted by a RAW convertor.
Nikon NEF RAW file converted in Capture NX 2
Nikon NEF RAW file converted in Adobe Camera RAW
Both the above files are from the same RAW file. The file was just opened in the RAW convertor and saved, without making any changes to the settings. You can see there are some slight differences in the way the two programs converted the image.
The version converted in Adobe Camera RAW has a slighter higher contrast. There is also a noticeable difference between the two images in the brightness and saturation of the green block on one of the posters, and the woman's red jacket.
Most RAW conversion software supports saving presets. So if you like your photos to have more contrast or less contrast than the program defaults, you can increase the contrast, then save it as a preset. You can then apply the increased contrast preset whenever you convert a file.
Ease of use
Unless you are emailing a photo to another photographer, you cannot just email a RAW file and expect the recipent to be able to view it okay. Nor do most photo sharing websites accept uploads of RAW files. Instead, you must first convert the RAW file to a JPEG.
Batch conversion of RAWs to JPEGs makes this relatively simple, or you can set your camera to record RAW + JPEG. (So the camera saves both the RAW and JPEG version of each shot).
Given that you will probably want to resize a JPEG file anyway before emailing or uploading it, having to convert from a RAW file does not cause much of an inconvenience.
In Windows, RAW files do not normally show up as thumbnails, whereas JPEG files do. This can be an inconvenience if you use Windows Explorer to view / manage your photos at all. This can be fixed by installing a RAW codec pack e.g. Microsoft Camera Codec Pack or FastPictureViewer Codec Pack. Mac users don't need to download anything - OSX supports RAW files natively.
Whether you want to shoot RAW or JPEG is really up to you (and whether your camera supports saving as RAW). If you are spending money on a camera because it offers good image quality, then I would really recommend shooting RAW so you can make the most of that image quality.
It also makes most sense to use RAW if you are shooting under many different types of lighting and don't want to (or don't remember) to change the white balance setting. You can just set the correct white balance when performing the RAW conversion.
On the other hand, if you shoot continuous bursts of shots (e.g. Sports photography), then you may be better served sticking to JPEG. The smaller file size of JPEG means it takes longer for your camera's buffer to fill up, and you can fit more images on one memory card.