RAW vs. JPEG

It’s a question asked over and over in forums, on websites, or even person to person. Someone new to photography, or most often new to DSLR photography, will inevitably ask the “pros” whether they should shoot in RAW or in JPEG.

Unsurprisingly there are a number of opinions on the subject. Anything from “Always RAW,” to “Always JPEG,” to “Depends on the shot,” and so, so many others.

While I’m not going to say definitively one way is right over the other, my personal view is that you should always shoot in RAW. To explain my standpoint, I’m going to start by giving you a comparison of the technical differences between a RAW photo, and a JPEG photo. Then some pros and cons. And finally I’ll give you some real-world examples.

But first, a bit of an anecdote; When I first got into DSLR photography in 2007, I was excited at the prospect of finally being able to shoot in RAW. I did my research, which lead me (like many others) to Ken Rockwell, and his “RAW vs. JPEG” post. In that, he does everything in his power to demonize RAW, declaring it to be a pointless waste of space and offering no advantage over JPEG. And he clinches his argument by declaring he only shoots in JPEG, and furthermore, on the Basic quality setting. Basic. That means highly compressed. It was at that point that I realized he’s bonkers. All of the examples he gives make it sound like he’s working on a computer that’s 10 years old, which makes sense because I believe that post was written in 2004. 30 seconds to open a single RAW image? Not any time in this decade. An example of someone shooting a Nikon D1X (an older professional camera) with only a 256MB memory card? Can you even still buy anything less than 1GB? Perhaps what he says was good advice in 2004, but it’s 2010 now, and his post is no longer accurate. It wasn’t good advice in 2007, and it’s certainly not good advice in 2010.

Technical Stuff

Now I’ve been interested in photography since 1995 when I took a Photojournalism class in High School because I needed an extra credit. I thought it’d be nothing more than a blow-off class, and I ended up falling in love with taking pictures. Some time before that I started working with digital imaging, and learned the difference between compressed and uncompressed images. I know that compressed images can look just as good as an uncompressed one, when done right. In college I even successfully argued for the use of JPEG still frames for my demo reel animations, instead of uncompressed Targa images that took up 8-10x the space, but visually looked no different.

Back then though, there wasn’t a 16bit colorspace, at least it wasn’t widely used. So when a JPEG and a Targa both share the same 8bit colorspace, it’s hard to imagine why one would keep the uncompressed Targa over the compressed JPEG if they look identical. Work uncompressed, finish compressed. That was my mantra. It means work in an uncompressed format (like Targa, TIFF, BMP, etc), and once you’ve finished your work and ready to archive it, save it out as a compressed JPEG (with the highest quality setting, of course). This works, because you’ve finished the work, and are no longer going to be altering the final image. So that even though they shared the same 8bit colorspace, when working with the uncompressed image, you never have to worry about compression artifacts building up and ruining your image with each subsequent save.

Now 16bit colorspace is far more prevalent. The RAW files that DSLRs produce utilize a fraction of that 16bit colorspace, with most consumer level cameras producing 12bit RAW, and higher-end consumer and pro cameras producing 14bit RAW. To give you an idea how colors increase exponentially, I’ve done the math here. To determine the amount of levels in a single color channel (R, G, or B) in a given colorspace, you take 2^x where x is the bit depth of the colorspace.

So for an 8bit image:
2^8 = 256 levels in each color channel.

For a 12bit image:
2^12 = 4,096 levels in each color channel.

For a 14bit image:
2^14 = 16,384 levels in each color channel.

Do you see that exponential growth? Each additional available level in the color channels equates to more information that you can work with. More ability to correct white balance, or pull back highlights and blown out whites, or bring up shadows and get some detail where there once was only black. Those levels refer to a scale from 0% of the color in that channel (or Black) to 100% of color in that channel (or Red, Green, or Blue). So with 8bit you have 256 levels from Black to Red/Green/Blue. With 12bit you have 4,096, and with 14bit you have 16,384. White is 100% of all three colors, and Black is 0% of all three colors.

So while 100% red will look the same whether you’re on an 8bit image, or a 14bit image (they’re both 100% on the Red channel), you will have far more variations available to you from full black, to full red, and this results in smoother color transitions. When you start mixing the three color channels, it results in far more colors available.

I should note here that you may often hear about “24bit color,” or “True Color.” This is a bit of a misnomer because all it really is, is taking the bit depth of each channel, and adding them together. So 24bit RGB is equal to 8bit R, 8bit G, and 8bit B, 8+8+8 = 24. If you apply that to the formula above, you would have 24bit, 36bit, and 42bit. I personally prefer to just stick with referring to the bit depth of each color channel. It’s accurate, and eliminates the potential confusion that someone who’s not knowledgeable about it might have; ie: “How can a 12bit RAW possibly have more colors than a 24bit JPEG?”

To see the total amount of potential colors available at each bit depth, you take the same formula, but then you also raise it to the power of 3 in order to accommodate each color channel.

8bit: 2^8^3 = 16,777,216 total colors. 16.7 million. This is JPEG.

12bit: 2^12^3 = 68,719,476,736 total colors. 68.7 billion. This is consumer level RAW.

14bit: 2^14^3 = 4,398,046,511,104 total colors. 4.4 trillion. This is pro-sumer and professional level RAW.

Let’s take a look at some pros and cons of each format.

RAW JPEG
Pro
Con
Pro
Con
12-14bit color depth Slightly larger file size Slightly smaller file size 8bit color depth
Easy to work with Requires a little more work out of camera* Easy to work with Cannot do much beyond what you get out of the camera**
Easy to share . Easy to share .
Uncompressed, or lossless compression . . Lossy compression

* This is more or less neither a con nor a pro. With the software you’ll be using it’s extremely easy to automatically apply a quick tweak to make sure your RAW image matches what you saw when taking the picture. I only put it as a con, because out of the camera a RAW file is often flat and dull compared to a JPEG, and inexperience will usually lead one to assume that’s a bad thing. The reason this is, is because a RAW photo has no processing done to it. You do the processing. JPEG on the other hand already has processing done in camera. The camera automatically applies contrast, saturation, and sharpening to the image. The most common analogy made when discussing RAW and JPEG in photography, is to say that you should think of the RAW as your negative, and the JPEG as the developed final image. With a negative you have a great ability to push or pull the exposure, or tweak the saturation, the contrast, etc. But with the final printed image, you’re pretty much stuck with what’s there. Which leads to the next footnote:

** Because the camera bakes contrast, saturation, and sharpening into the photo, you’re left with little leverage after the fact. If the shadows are too dark, you don’t have the ability to lighten them very much. If the sky is blown out, you don’t have the ability to recover much of the detail. While I mentioned that a little out of camera work on a RAW is technically not a con, this most certainly is.

At first glance they look fairly evenly matched. But when you’re talking about photography you should be thinking about getting the best images possible. And with the higher bit depth of color available when you shoot in RAW, that to me weighs a lot more in favor of RAW than a slightly smaller file size does in favor of JPEG. And I do mean slightly smaller. I shoot with a Nikon D80 which is 10.2 megapixels. The RAW images it produces are anywhere from 10-14 megabytes each. The only acceptable JPEG compression in my opinion is Fine, and that produces images that are 6-8 megabytes. Sure, this small difference starts adding up when you’re talking about 1,000, 5,000, 10,000+ images, but even at the most drastic size difference (6 megabytes vs. 14 megabytes) we’re talking about ~8 gigabytes of storage difference for every 10,000 images. With 1 terabyte hard drives (~1,024 gigabytes) costing $100 or less now, and continuing to come down in price, I’m more than happy to sacrifice 0.08% of my hard drive in order to ensure I will have the most control over my images.

Now, I wasn’t always of this mindset. When I purchased my first DSLR I thought that maybe I would use JPEG for any snapshots and photos that I wouldn’t consider “artistic.” Stuff like pets, and the family holiday gatherings, etc. That I would use RAW for my “artistic” shots, stuff that I would consider adding to my portfolio. This worked out ok for a little while, until one day I forgot to switch back to RAW when I went to shoots some of those possible portfolio shots. Not only did I forget to switch to RAW, I forgot that my white balance was still set for an indoor fluorescent light. And here I was snapping away in sunshine and shade. After a while of this it dawned on me, and I switched back to RAW and Auto on the white balance. But the damage was already done. When I got back to my computer to sort through the days photos I tried to fix them with white balance adjustments, but it was no use. I ended up trashing all of the JPEGs from that day, simply because they were unsalvageable.

My alternative from then on was to either shoot RAW+JPEG, or just RAW. Now this may sound a little hypocritical of me, but hear me out: I chose to stick with RAW, because RAW+JPEG just seems like a pointless waste of space. The reason it’s not hypocritical in light of my “hard drives are cheap” reasoning above, is because RAW+JPEG offers absolutely no advantage over just shooting RAW. I’m willing to use extra space for RAW, because it offers significant advantages over JPEG. But using extra space to store both a RAW and a JPEG is just pointless and silly.

The proponents for RAW+JPEG try to argue that it’s better because you have the RAW to play around with when you want, and the JPEG that you can immediately share with family and friends. Now I don’t know about you, but my idea of sharing photos with family and friends is either emailing them, posting them on Flickr, SmugMug, Picasa, or printing them out for them. In all of those cases I can do that very shortly after getting the photos into my computer. If I have my computer with me, it’s even more instantaneous sharing. The only scenario that I can imagine you could possibly make a case for RAW+JPEG is if you want to copy off your pictures to your family or friend’s computer from your camera. But there’s one flaw even in that scenario: Picasa is free, and works on Mac, Windows, and Linux. So no matter what operating system their computer is using, you can download (if they don’t already have it) Picasa and import your RAW photos from your camera. And if they have a Mac, chances are they already have iPhoto. Sure, they may not have the processing ability of something like Aperture or Lightroom, but they do have enough that you can punch up the colors and adjust contrast and sharpening. They have enough that your RAW images wont look flat and dull.

The myth that working with RAW images is so much more difficult than working with JPEG images is just that: Myth. It may have had some merit 10 years ago, maybe even 5 years ago, but times have changed. It’s time we stop perpetuating this myth.

Still not convinced? How about some actual real-world examples?

824191440_72Nog-L-2010-03-28-13-481-2010-03-28-13-48.jpg824191564_b9Nup-L-2010-03-28-13-481-2010-03-28-13-48.jpg

On the left side is the RAW, unprocessed, straight out of the camera. For this shot I was going for the silhouette look, but for the purpose of demonstrating the advantage of RAW over JPEG, let’s see what details are hidden in there. This was taken with a Nikon D40.

On the right side is the RAW, processed. This is quite amazing as the bottom half of the shot was practically solid black. But because RAW has far more variations in each color channel than JPEG, I was able to recover just about everything in the shadows.

Here are the Aperture processing settings (and their Lightroom equivalent if there’s a difference):

+2 Exposure
-5 Black Point
100 Shadows (Lightroom equivalent is Fill Light)
Burn brush at 75 to pull the sky back from being blown out
Curve adjustment to bring in some contrast. (Lightroom 3 Beta 2 finally added full curve adjustments, but only for the luminance channel (the lightness/level of all 3 colors combined.) Fortunately luminance is adequate for this adjustment.)

I could have pushed exposure even higher, or added some brightness to further improve on this. But I think this more than adequately demonstrates the level of control you have when you shoot RAW.

824191600_AgHB5-L-2010-03-28-13-481-2010-03-28-13-48.jpg824191663_f8ebs-L-2010-03-28-13-481-2010-03-28-13-48.jpg

On the left side is the JPEG, unprocessed, straight out of the camera. For all the JPEG conversions I took the out of camera RAW and exported it as JPEG with 100% quality. This would be equivalent, and actually even a little better than shooting JPEG Fine with the camera (Fine is typically around 85-95% quality).

On the right side is the JPEG, processed. It’s almost laughable how little recoverable detail is available in the shadows with the JPEG. I even kept the contrast from going fully black, just to prove those areas are actually missing details, and are rather solid blocks of color (or lack of color).

Here are the processing settings:

+2 Exposure
-5 Black Point
100 Shadows
Burn brush at 75 to pull the sky back from being blown out
Curve adjustment to bring in some contrast.

Shocking, isn’t it? Now you not only have the hard numbers, and the pros and cons, but also visual proof how drastic a difference you can get with RAW. And remember how I said the file size difference between the RAW and JPEG are only slight? Granted these are D40 and much smaller than my typical D80 shot, but the RAW file is 3.7 megabytes while the JPEG is 1.8 megabytes.

Let’s see another example, this time with severe over-exposure:

824191715_z7yTS-L-2010-03-28-13-481-2010-03-28-13-48.jpg

This is the straight ouf of camera RAW, unprocessed shot. For this shot, I focused on the player around center ice where it was considerably darker with more players clustered, as well as graphics on the ice. Unfortunately, even though I had continual focus set, it seems my D80 did not re-meter the shot as it traveled from the darker center ice, requiring a longer exposure, to the brighter goal area that needed a much shorter shutter speed. The brighter ice, combined with the longer exposure conspired to produce this blown out shot.

824191862_sLiSU-L-2010-03-28-13-481-2010-03-28-13-48.jpg

Isn’t RAW wonderful? This could actually be a usable shot now.

-2 Exposure
+3 Black Point (this is default)
50 Shadows
Curve adjustment to bring in some contrast.

It could probably use a little Burn brush to bring down the highlights in the ice a bit more, maybe even continue bringing the exposure down overall. But you can already see a drastic improvement. Details that were lost to white are now visible and distinguishable.

By the way, the file size for the RAW file is 6.8 megabytes while the JPEG is 4.34 megabytes. Still a minor difference in file sizes.

824191911_bHaZz-L-2010-03-28-13-481-2010-03-28-13-48.jpg

Here’s the JPEG conversion, looks identical to the out of camera RAW.

824191960_KHCyF-L-2010-03-28-13-481-2010-03-28-13-48.jpg

And here’s the processed JPEG. Same processing settings, save for the curves which I manually tweaked in order to get even this level of detail recovery.

Where’s the goal net? Hell, where are the players? They simply disappear, disembodied uniforms strewn across the ice. And most of the graphics on the ice are gone.

For fun I did a couple more that I re-discovered in my library recently:

824192035_MkCPg-L-2010-03-28-13-481-2010-03-28-13-48.jpg824192272_P9t9p-L-2010-03-28-13-481-2010-03-28-13-48.jpg

On the left is what came out of the camera. I kid you not. And on the right is what I was able to recover in just a few seconds. If you look really close, you can see the faintest hint of the paint line in the bottom right corner if you don’t believe these are the same pictures, and not just a black rectangle sitting next to the real photo.

This is what happens when you’re most definitely NOT a morning person, and you’re up far too early to try and comprehend your camera settings at that particular moment. I took this shot and looked at my LCD, then scratched my head wondering why it was blank. So I took a 2nd shot (I’ll get to that one in a bit), and it too was blank. Then it slowly started to dawn on me, and I checked my camera settings:

ISO 100 oops! (Remember, this is pre-sunrise early dawn), zoomed in to 200mm f/5.6. Oh yeah, and -5ev. DOH! These shots were about a year ago, so I don’t remember exactly what I was shooting prior that I had it set to -5ev, but them’s the breaks. This is precisely why I shoot RAW 100% of the time, at least I can typically fix my dumb mistakes.

+2 Exposure, that’s right. Just +2, which roughly equates to making the -5ev a -3ev.
-5 Black Point
.2 Brightness
100 Shadows
Curve adjustment to bring in some contrast.

I could probably push it farther with more exposure, but since this isn’t that great of a shot anyway, I wasn’t going to spend much time on it. But the point that needs to be made is that if this was one of those great shots that you only have one chance to get, and you forget to properly adjust your camera settings… with RAW you have a chance to get at least something out of it. Yes, this highly exaggerates the noise (this ISO 100 looks more similar to something between ISO 1600 and 3200), but a high ISO usable image is far better than having to trash your image because JPEG just can’t compete.

824195039_T8eNy-L-2010-03-28-13-481-2010-03-28-13-48.jpg824195229_YUnfH-L-2010-03-28-13-481-2010-03-28-13-48.jpg

Here is the JPEG conversion, and the processed JPEG on the right.

I’ll be honest, far more than I expected was recovered from the near black. But this image is still most definitely not usable. Again I pulled back on the contrast a bit to show the large blocks of gray, and show that they really are solid blocks and there are no details present.

+4 Exposure
-5 Black Point
.2 Brightness
Curve adjustments to bring in some contrast.

You’ll notice I even increased the exposure to +4 instead of +2. +2 was still far too dark.

And just to demonstrate how magical curves really are, here’s the JPEG conversion with all the same processing settings, with no curves adjustment:

824192750_wPRSL-L-2010-03-28-13-481-2010-03-28-13-48.jpg

It’s truly amazing what a slight adjustment to the curves can actually do.

Shot attempt #2:

824195300_ytCCM-L-2010-03-28-13-481-2010-03-28-13-48.jpg824193069_CaAHc-L-2010-03-28-13-481-2010-03-28-13-48.jpg

This is the 2nd attempt that I mentioned earlier. On the left is what came out of the camera, and on the right is what I was able to recover in just a few seconds. You’ll just have to trust me on this one, I can’t see anything in the out of camera shot that I can point out to show they’re the same image.

+2 Exposure
-5 Black Point
.2 Brightness
100 Shadows
Curve adjustment to bring in some contrast.

I could probably push it farther with more exposure; that and a tighter crop might actually make this shot usable.

And the last one, I promise:

824193212_yBAM2-L-2010-03-28-13-481-2010-03-28-13-48.jpg824193439_f44oP-L-2010-03-28-13-481-2010-03-28-13-48.jpg

Here is the JPEG conversion, and the processed JPEG on the right.

Yep, still unusable and beyond repair.

+4 Exposure
-5 Black Point
.2 Brightness
100 Shadows
Curve adjustments to bring in some contrast.

Mathematical proof that RAW is the superior format, proof that the pros and cons do not weigh in favor of JPEG, and irrefutable visual proof using real world examples.

Which format you use, however, is ultimately up to you. It’s my hope that you’ll see the advantages of RAW far outweigh the negatives (no pun intended). And if your camera doesn’t have the option to shoot RAW images, and you’re forced to use JPEG, then hopefully if you’re serious enough about photography this post will be that extra incentive for you to finally upgrade to a DSLR. For the many other advantages of a DSLR, not just RAW.

When thinking about what software to use for processing you can go the free, or extremely cheap route with Picasa, or iPhoto. The major drawback to these is the lack of extensive processing tools. You could probably get similar results like these by fiddling with the Exposure, Highlights, Shadows, Brightness, and Contrast sliders in those programs. It probably won’t as drastic an improvement, but at the same time hopefully you don’t need that drastic an improvement. Hopefully your shots are good enough that you only want minor or no tweaks. And if you primarily are interested in nothing more than snapshots and family photos, by all means stick with the free options. It’s not very likely you’ll be shooting 3000-5000 or more photos each year.

On the other side of free you’ve got applications like Apple’s Aperture, and Adobe’s Lightroom. Aperture will run you $199, and $99 for future upgrades. Lightroom is $299, and $99 for upgrades. These applications typically have had 18-24 month cycles between major upgrades, so if you’re serious about your photography, even if you’re no more than a hobbyist or amateur for now, it’s worth your while to budget $100 every couple years for one of these upgrades (granted the initial cost to get started will require more budget). There are, of course, other options for software. There’s Bibble Pro, Capture One, Lightzone, and even your camera manufacturer’s own software (at least Nikon and Canon produce their own, not sure about other brands). But these two are the big ones, these are the ones the vast majority of photographers who use software like this will be using. If you use Windows, then your choice is fairly clear; Aperture is only available for Mac, while Lightroom is available on both (and if you use both, naturally a single license only covers the operating system you bought it for. If you want to use it on both systems, then you have to buy two licenses.)

I personally have used both Aperture and Lightroom, from their 1.x versions up until now (Aperture just hit version 3 about a month ago as of this writing, while Lightroom is currently in open beta testing for version 3, and should be available within the next few months.) For my thoughts on both, you can check out my post.

All of these programs make working with RAW just as easy and painless as working with JPEG. From organization, to adding contrast, saturation, or sharpening. They also all make sharing them ridiculously easy. You can email them, or send them to any of the major photo sharing sites, either built in directly to the program or through various plug-ins developed for them. And of course printing is readily available. You’ll even get your choice of printing a single 8×10 per page, 2 4x7s, 4 3x5s, and several other layout options. The only real question you have to ask yourself is whether you’re serious enough about photography to justify spending money on software, on top of your gear. At the very least go download the 30 day trials of Aperture and Lightroom, play around with each one separately (don’t try using both at the same time, it won’t give you adequate “face time” with each individual application to familiarize yourself with it enough to make an informed decision). Grab Picasa and play around with that. And if you have a Mac you’ve already got iPhoto, so play around with it too. Find the one that works best for your needs and roll with it.

So what’s it going to be? RAW or JPEG? Above all, always remember to have fun.