RAW vs JPEG
Categories:
Features,
Library,
Beginner Column [home]
Author: James Wiseman [ ] (Industry)
Over the past year, quite a few prosumer (and all of the DSLR) cameras that have been released now provide the ability to shoot using the camera's RAW image format. This format differs slightly from camera to camera, but in general, a RAW file is a collection of the image data from each pixel before it has been processed by software in the camera (called firmware). I like to think of a RAW file as a “digital negative” and as a JPEG as a “digital print.” The quality of the digital negative (RAW file) never degrades and it can always be re-used in the future to make an infinite number of different “digital prints.”
As the RAW format becomes widely available, many digital shooters wonder if this format is “better” than shooting JPEG - of course, “better” often depends on the circumstances. This short column will describe the difference between the two formats and pros and cons of shooting one versus the other.
Filesize and Bit-Depth
Digital SLR RAW files are approximately 12 bits per channel, as opposed to 8 bits per channel for a JPEG. Many RAW formats are not compressed at all, and the ones that are compressed are compressed with a lossless algorithm, so no information is lost. On the other hand, JPEGs are always compressed with a lossy algorithm – the amount depends on the “quality” value that you set on the camera. As a result, RAW files can be quite a bit larger. As an example, RAW files from the S2pro are 12 megabytes in size, and high quality 12 megapixel JPEG's are about 4.8 megabytes. On a six megapixel camera like the 10D or D100, raw files are 6-8 megabytes and JPEGS are typically 1-3 megabyte per file.
So how important are the extra bits? The answer is that they are VERY important! Each bit represents a doubling of the recorded value, so 8 bits = 2^8 (256) possible values of information and 12 bits = 2^12 (4096). To put this in photographic terms – a bit = a stop. Since a stop equals a doubling of recorded light and a bit equals a doubling of recorded information, it's easy and correct to make this analogy. So the practical implication is that shooting in RAW you can record FOUR STOPS more dynamic range than shooting in JPEG. This is very important for shooting high-contrast scenes, such as sunbursts, whale sharks, etc. The following JPEG (while not a good shot) is a good example of a high-contrast scene.
![]()
(F8 @ 1/125 th JPEG from the S2pro)
As you can see, the shot goes from almost pure black to almost pure white in the center of the sunburst. The important feature of this shot – taken as a JPEG with the S2pro – is that there are really only 3 shades of blue in the water. With a little flash fill, there are perhaps 3 shades of gray in the detail of the coral. In total, there are only about 6-7 stops of range in this shot. Closing down to f11 or f22 would have helped darken the water a bit, but would require a much more powerful flash for foreground fill. The “take home” message is to use RAW to capture as many shades of blue as possible – resulting in beautiful smooth blue backgrounds.
RAW File Converters and Photoshop
A RAW file converter takes the place of the camera's firmware, and uses your computer's processing power to turn a RAW file into a JPEG or a TIFF. Photoshop CS now comes with a converter for many cameras, and many high-end digital cameras come with their own software (example: Nikon Capture or Fuji EX2.0). Because the converter can be set to make a TIFF file, no information is lost via file compression. Another awesome capability is exposure correction or “pushing” using the converter. Because of the great amount of information contained in a RAW file, the exposure can usually be corrected up or down by at least a stop, and many times 1 ½ to 2 stops.
Post Processing vs Camera Firmware Processing
As stated above, digital camera firmware converts the RAW sensor data into a JPEG file though a complicated process. Every camera does it differently and it's hard to say exactly what each model does. The firmware assigns RGB values to each pixel, chops off 4 bits from the image, usually in the shadows, and then applies a white balance. Next, the firmware sets contrast, color curves, sharpness, saturation, etc. Finally, a compression level is set and the file is saved as a JPEG. Since every camera performs this process differently, two different camera models with the same settings will result in very different images. Shooting RAW leaves these decisions up to you the photographer to set in post-processing. Because of the full feature set of the RAW converters available, usually it is possible to correct an image (setting all of the above parameters yourself) without ever using Photoshop. If you don't have time to process each shot, you can use the default converter values and the white balance recorded by the camera and you are no “worse off” than if you had just shot a JPEG. If/when you have more time later, you can go back to a good shot's “digital negative” and really work with the image to make it look its best.
Pros and Cons
I've put together a summary table of pros and cons of shooting the two formats:
| Format | Pros | Cons |
|---|---|---|
RAW |
Exposure Latitude | RAW converter required |
| Higher Dynamic Range | Post Processing Time on the Computer | |
Digital Negative |
Limited Burst Capacity (7 or 9 shots) | |
| No Preset White Bal. | Fewer Shots per Memory Card | |
Noise Smoothing in software |
||
| JPEG | More Shots per Burst |
White Balance Fixed |
Quick Delivery Time |
File Compression | |
| No Converter Req'd | Limited Adjustment Capability | |
| Smaller File Size | Noise is “Built Into” the Image |
Hopefully this short column has cleared up some questions about the RAW file format. If you'd like to learn more, you can find many RAW Format GURUs in the Image Processing, Printing, and Storage forum at Wetpixel.
Page 1 of 1 [ ]
Comment(s):A quick note: if you nail your exposure and white-balance, and are shooting a frame that doesn’t have a huge amount of contrast, shooting RAW won’t get you much more than if you were shooting Fine JPG. However, it can’t hurt to shoot RAW, because if you don’t nail that shot, there is some latitude for you to play with. :)
Posted by Eric Cheng on 03/05 at 12:28 AMFolks,
First let me make sure people know James, Eric and others here at Wetpixel are friends. Sometimes with different opinions, though....
I know Wetpixel has discussed the tecnical reasons why RAW is better in many forums. The article detailing JPEG compression “throwing away” data while technically correct is misleading. The particular statement that once you leave RAW your JPEGS will be like 1MB, thus becoming unsuitable for printing 8"X10" (or even larger after some post processing) and unpublishable, etc. is misleading IMHO.
On my Nikon D100 a Fine/Large JPEG has NEVER been less than 2.2 MB, and my new Canon Digital Rebel averages about 3.1 MB!! This of course is determined by how much detail (i.e. information) was captured in the image. As soon as you do any Adobe program layers adjusting color, USM, etc. these files grow.... Like up to 20MB or more!!! Nosie is also a factor of what ISO you recorded the file at, individual sensor of your camera and other factors.
Believe it or not there are photographers out there selling work that were originally Fine/Large JPEG files. They may have experimented with what white balance they like, sRGB or Adobe color space, and also are pretty good at getting a decent exposure at the time of capture. Plus modern digital cameras use algorithms that while throwing away bit depth still maintain significant information. No manufacturer makes a camera that is designed to produce crappy files!
To James credit he stresses your final usage should determine the file format you choose. Other issues like buffer size, file write times, memory card size, etc. were presented in his PRO and CON table, and he should be commended for compiling these details.
I’m sure I’ll experiment with RAW in the future. Photographer friends (in addition to James and Eric) such as Phil Colla, Scott Johnson and others tell me adjusting all the things you can on a computer screen with a RAW file has to be seen to be believed. But for many underwater photography enthusiasts I think we shouldn’t complicate the whole process as they begin their digital journey by telling them RAW is the only way to shoot....
IMHO
YMMVDavid Haas
Posted by David Haas on 03/05 at 01:10 AMDave -
You’re right. We can be friends, and disagree. Here we go. ;)
Wide-angle blue-water shots will definitely be close to 1MB, at least, on a 6MP Canon dSLR. The more of the blue captured, the smaller the file. My 6MP Fine-JPG shots are often close to 1MB, when shooting wide-angle, underwater.
“The particular statement that once you leave RAW your JPEGS will be like 1MB, thus becoming unsuitable for printing 8\"X10\" (or even larger after some post processing) and unpublishable, etc. is misleading IMHO.”
James did not insinuate that resulting JPG images are unpublishable. Small file size does NOT necessarily mean poor quality. It just means that the file is compressed in some way. And if you do your Photoshop adjustments and save it out as a JPG again, the file will still be small. It does not “grow” unless you save it in a different format. In fact, if you argue that you should shoot JPG in-camera, you might as well argue that you should just re-save the file as a high-quality JPG after doing your adjustment work. After all, people publish stuff captured in JPG all the time, right? Why do you save it as a TIF or PSD file? Because it’s lossless, and because you can have a higher bit-depth.
“[Noise] is also a factor of what ISO you recorded the file at, individual sensor of your camera and other factors. “
“Other factors” include JPG compression artifacts, which can exacerbate how bad noise looks.
“Believe it or not there are photographers out there selling work that were originally Fine/Large JPEG files.”
Good point. AND… no one is disputing that. :)
“Plus modern digital cameras use algorithms that while throwing away bit depth still maintain significant information.”
Modern vs. “antique” digicams—JPG is 8-bits per channel. That’s the limiting factor, not anything else about the camera.
“But for many underwater photography enthusiasts I think we shouldn\’t complicate the whole process as they begin their digital journey by telling them RAW is the only way to shoot....”
From what I’ve seen, only people who are afraid or new do not shoot RAW. The prospect of shooting RAW and the accompanying headaches associated with workflow is not an easy thing to want to take on. But I do not know anyone who has switched to RAW who has continued to shoot JPG when the shot matters. That’s saying a lot. I’m not so sure that a valid comparison can be made, if one has no experience with shooting RAW! (I mean that it’s important to really understand the workflow in order to be able to internalize the pros and cons).
However, the bottom line for a working pro is that if you can sell, and you’re shooting all JPG, there’s no reason to switch over. Shooting RAW costs more, in terms of time, and money (more storage space, and converter apps). If you have the storage space, it can’t hurt to shoot RAW, batch convert to JPG, and continue to work in the JPG world from the converted files. If you have a shot that just needs a bit more work, you can finally go and learn how to deal with RAW files.
Posted by Eric Cheng on 03/05 at 01:13 AMA quick correction to the article: many RAW formats actually ARE compressed, but they use lossless compression, so you get back every bit that was there originally. RAW formats just record what the sensor saw, and it’s up to the software to construct an image out of it (which is why different converters produce different results). When you shoot JPG, you can think of your camera as running the bits through its own RAW converter, compressing the resulting file to JPG format, and then saving it out to the card.
Posted by Eric Cheng on 03/05 at 01:19 AMOne more point: if you are shooting blue-water subjects with lots of smooth lines and color, shooting JPG is pretty damn good. But if you are shooting macro subjects with lots and lots of detail (or something like a forest, topside), you absolutely want to shoot RAW. JPG artifacts will be very clear in the tiny details, and you don’t want 1) artifacts, or 2) sharpening without your control.
Posted by Eric Cheng on 03/05 at 01:33 AMShooting all blue water? What kind of photo is that? :) I can see where small JPEGS could result from that type of shot.....Plus noise in blue water as James states in his article.
I was incorrect in not stating that after working on a Fine/Large JPEG file I’ve been saving them as .PSD, a Photoshop document. That’s where the file size growth comes from, the format. Very important point Eric makes about NEVER re-compressing a JPEG file as another JPEG continually throwing away data and introducing noise…
Eric is also right in that sitting down and forcing myself to learn and develop a RAW workflow is something I’m intimidated by. Hey, I’m an old fart barely using a computer to any extent for 4 years! I’m also probably not unique that I’m not going to buy every new computer upgrade in speed, processing power, etc. as it comes out. So I’ve learned to live with certain limitations....
I’m sure the “RAW” mojo will grab me soon, expecially with a few trips scheduled in 2004 where I’ll want the images to be adaptable to any end use....Adobe CS finally having RAW conversion capability built in will likely be my first step....
Best regards,
David Haas
Posted by David Haas on 03/05 at 01:43 AMObviously, I didn’t mean shooting all blue water. I mean, shooting a large, smooth subject in blue water—like a lone shark. Your images will be around 1MB.
Posted by Eric Cheng on 03/05 at 01:52 AMGood article James.
I shoot virtually everything RAW now, even topside. The single biggest advantage in shooting RAW for me is the ability to white balance after the shot. I shoot virtually everything on Auto WB, then adjust as needed after the fact. If I am in a rush, I’ll use my RAW convertor (Capture One) to determine what an appropriate white balance setting is, then apply to to all of the shots from that set. This works fairly well UW, and even better topside. It does assume consistent lighting, which isn’t always the case, but if I’m really concerned about the shot, I’ll go back and work on shots individually as James pointed out.
I’ve read arguments that you can accomplish the same effect using JPG and Photoshop, but I’ve never been able to produce the same quality of result using curves, levels and color balancing. This may be attributed to the fact that the in-camera JPG conversion scraps a bit of the data, or it may just be my lack of PS skills.
Ironically, new photographers tend not to use RAW, and it’s those people who could probably benefit most from the additional latitude you gain in terms of white balance and exposure.
Tom
Posted by Tom Shepherd on 03/05 at 02:31 AMOne clarification: Saying that the in-camera RAW processing software “chops off” 4 bits per channel can be confusing. It maps the in-camera 10-12 bits to 8 bits, using whatever algorithm it uses. But black is still black, and white is still white. There are just fewer gradations in each channel for color representation.
Posted by Eric Cheng on 03/05 at 02:49 AMWow! I’m really happy to see these comments and debate guys - it means people are thinking hard about this one!
Here’s a suggestion for folks intimidated by RAW - Shoot a whole dive on RAW with all the same settings you usually use to shoot JPEG. Then when you want to make JPEG’s, use a “batch converter” along with the camera’s recorded settings to make your jpegs. All this takes is to push ONE BUTTON on your computer. In essence, the computer will do the exact same processing your camera did underwater before it recorded the file.
But keep those RAW files!
Perhaps right away, or maybe later, go back to a shot you really liked and open the RAW converter (like PhotoshopCS). Use it to set white balance, shadow detail, noise smoothing, etc. You will really be surprised what you can get out of that puppy! It will encourage you to try it again and again…
Since you set shadows, brightness, and contrast, you are esentially controlling those extra 3 or 4 bits the way YOU want, as opposed to the camera’s “black magic” that Eric refers to above.
Underwater, and in high contrast shots, this is VERY important.
A good example of all this is a dive trip I went on w/ Craig Jones. I shot all RAW for the first time and Craig helped me get comfortable using the Photoshop Adobe Camera Raw. I did all my conversions on the boat and made TIFFs of all my good shots.
Later, I had a hard drive crash and I had everything backed up EXCEPT those RAW files. Going back and looking at the TIFFs, I KNOW I could have done better conversions - especially with the new Photoshop CS converter.
What’s the lesson? With the RAW file, you can always go back when new and better software comes out an rip a new TIFF from that RAW file. The RAW file is the “digital negative.”
And Dave, I understand that pros sell JPEG’s all the time and I think that’s fine. It’s not the filesize that I see as a problem with JPEGs. It’s the fact that it’s not all the information that the camera COULD HAVE produced - and you can never get it back. This - at least to me - has been extremely important for underwater shooting where we have very high contrast.
Good comments, keep them coming!
Cheers
JamesPosted by James Wiseman on 03/05 at 01:30 PMMy head is spinning trying to figure out what to say without talking in circles or rambling. Yes, I believe in shooting RAW. Shooting JPEG is like buying the super sized 256 pack of Crayola crayons and then throwing out most of them before you oepn the coloring book. It just seems wrong. But, in real world practicality, the 8 bit vs. 12 bit arguement is not as strong as you might think.
”....practical implication is that shooting in RAW you can record FOUR STOPS more dynamic range than shooting in JPEG.”
One could infer from that statement that if you took a RAW shot of a scene with a seven stop dynamic range, the JPEG version of the same shot would only yield three stops. Clearly, this is not the case.
There can be the appearance of additional dynamic range because the extra bits can provide distinctive data points, i.e. more detail rendering, especially in the shadow areas.
The primary advantage of the 12 bit data is that when the image is adjusted in Photoshop or like program the increased number of possible output values prevents banding and posturization. Without this image manipulation, the differences are much harder to distinguish, if at all. So, a raw file contains no more dynamic range than does a jpeg, just finer resolution within that range.
There are several considerations to selecting the most appropriate format:
1) Contrast vs. dynamic range. The higher the contrast, the more detail you will lose. If you shoot JPEG it is imperative to use a low contrast setting as you already throwing out possible data points.
2) If you typically do heavy manipulation, i.e. curves, you need the extra bits of information to avoid banding and posturization caused by quantinization. This is especially evident in dark blues.
3) If you are shooting fast (not so common underwater), JPEG may be your best choice. Go shoot some fireworks on July 4 and you will quickly realize RAW isn't such a good idea. Same with a baseball game.
4) Specific cameras play a part in how much post processing, if any, are required for a JPEG. This leads to the issue of whether post processing would benefit from the extra bits. This is why Ken Rockwell's “Just shoot JPEG and get it right the first time” approach has holes in it. The S2 has limited white balance settings. So, you may not get the exact color temperature you want from the camera settings. The D100 JPEG rendering has significant anti-aliasing of detail. This requires careful post capture sharpening. There are more examples, but using JPEG allows the cameras firmware to interpret the data. This often leads to results that need significant post-processing.
5) Controlled versus uncontrolled lighting. Many studio and wedding photographers can achieve spot on results shooting JPEGs, thereby increasing throughput and productivity because they can control the light or at least do a shoot under constant light. Landscapers and underwater photogs deal with uncontrolled and ever changing lighting. The ability to manipulate RAW files can be a huge advantage.
6) As I tell people who are trying to select a camera or film, start at the end of story. What's the final output? If you don't do much manipulation and the end product is a print, then RAW doesn't mean much. The printer can't do 12 bits. To restate it another way, if your JPEG edits aren't going to create banding or posturization, then the prints aren't going to look any different if you shot in RAW.
Bottom line, there are times when JPEG is a better choice than RAW. There are times when JPEG results will not be noticeably different than RAW. Try to get everything right in the first place. But, if you don't RAW can be a wonderful thing. I'd rather cover my behind and shoot RAW.
P.S. The Sony brand RAW converter takes their 12 bit images and converts them to 8 bit for you. Oops! It was probably easier for the programmer to write the software that way.
Posted by on 03/06 at 12:32 AMRaw vs JPEG arguements are always guaranteed to draw strong opinions. And I'm going to give mine: JPEG is only good if you can nail exposure AND white balance perfectly, and are willing to live with somewhat lesser image quality.
Faster computers, bigger storage cards and Photoshop CS with decent 16 bit support make RAW even more attractive than it was last year. Remember that next year's RAW converter may be better still - if you've got those shots archived as RAWs you may be able to develop them even better in the future than you can now.
Get a good converter like C1 and RAW need not be intimidating even for beginners to digital.
Posted by Rob Whitehead on 03/08 at 06:51 PMI would like to add a comment on RAW that may be important for new users of DSLR and this file format. I have a Nikon D1 bought at the end of 1999. I fell disapointed for not having used RAW sooner… Why ? Camera firmwares do not change much as time passes because manufacturers concentrate on news products. Hopefully software does.
You cannot imagine how using Nikon Capture 4.1 has changed the quality of my final images. It is like a rebirthing. The inboard image processing of the D1 looks really crappy now. But using RAW format with recent software permit far better images that the D1 was able to do in 1999 !
If you are going to keep your DSLR for a while, save your images in RAW because you will be able to edit then in one, two or four years and benefit from the image processing evolution and make adjustments your camera can not do today. You may be able to recover files concidered lost.
Cheers,
Stéphane
Posted by on 04/08 at 07:27 AMThe suggestion to do a shoot completely RAW for a chance could better be a different one. Almost all DSLR’s have the option to shoot RAW and JPG at the same time. Go ahead and try that, it will leave you with a shoot where bursts are not an option but at least you have all the reference that you need to make your decision.
Rutger Geerling (Rud-gr.com)
Posted by Rutger Geerling on 08/11 at 05:44 AMBy all means, if your camera shoots RAW+JPEG then go for it. The most popular underwater DSLR (the D100) does not have that feature though.
Cheers
JamesPosted by James Wiseman on 08/12 at 12:39 AM
You must be logged in to post comments. Please log in or register (it's free!) and come back to this page to leave your comment.
Next entry: Wideangle distortion correction with PanoTools
Previous entry: Laz Ruda - Rodales POTW
