RAW vs. JPEG

“Professionals only shoot RAW because the pictures come out so much better than JPEG”

Ever hear that?

I have…with variations:

“If you don’t shoot RAW your pictures will lose quality every time you open and look at them.”

“You can’t correct white balance in a JPEG, only in RAW.”

And my favorite…

“REAL photographers only shoot RAW!”

Also, some not so silly ones:

“RAW colors are so much richer because the file has more bits per pixel.”

“RAW images never degrade when you edit them. JPEGs lose data every time you edit and save them.”

Truth? Mythology? Some of each? Let’s dig up some facts…

What’s Inside?

I guess the easiest way to explain the pros and cons of RAW vs. JPEG is to start with defining them.

JPEG – JPEG stands for the Joint Photographic Experts Group which is a standards group that originated the compressed file format in the early ‘90s. It has been the de facto standard since digital cameras started flooding the mainstream over a decade ago. With very few exceptions, all cameras can record images in the JPEG format. A JPEG file consists of a “header” that describes the format to software used to view or edit it and contains space to store information about the image. JPEG uses EXIF (Exchangeable Image File Format) data which is a structured format where camera settings, time, date and other bits can be stored in the header in a way compliant software can read and use. The rest of the file contains the information used to re-assemble the image in viewing or editing software.

RAW – RAW stands for…RAW. It is the basic image information from the sensor before the camera’s processor “cooks” it into a viewable image. When a digital sensor records the light that strikes it, the support hardware translates the analog electronic signal levels from each pixel into a digital value and sends it to the processor. CMOS chips actually do a significant amount of pre-processing at the sensor level so RAW is actually a bit of a misnomer. I suppose we can view it as getting a package of raw steaks instead of large unruly animal. Anyway, the RAW file contains all of the image data and the information that the systems processor would use to apply all of your settings like exposure compensation and white balance to the image if it were to processes the image into a JPEG. Though RAW does not support EXIF, it contains all of the info like shutter speed, aperture and anything else your camera stuffs into the EXIF area of the image header when processed. The EXIF data is written to an exported JPEG by most software. Since a RAW file is raw, it really can’t be viewed without processing all of that info into a viewable format so it also contains a small processed version of the image in JPEG format (or TIFF in some older cameras) for review on the LCD or in the viewfinder and preview in image organizers and file management systems like Windows Explorer.

Working With The Files

Viewing and editing JPEGs is straightforward. Open, edit, save. All common editing software supports it and works with it. A JPEG from a $9000 Leica or a $100 GE P&S will open in any editor you can name.

RAW, being raw, contains basic image data and the other information used by the camera’s processor to “cook” the final image. Since these processors are proprietary to the various manufacturers, the RAW file format from one make of camera is not the same as one from another make. To make matters even more complicated, RAW format may vary considerably from model to model from the same manufacturer. Since changes to the basic image data cannot be saved back to the file, the image editor needs to decode the format and process the image into an editable format (usually TIFF) before it can work on it. (Actually most RAW formats allow changes to the file’s image processing settings from the camera to be saved after you adjust them, but the image itself and the original settings remain untouched). In the past, this could only be done by using software provided by the manufacturer to make the basic adjustments then saving the TIFF file so it could be loaded into an editor. Now most every relevant editor or organizer supports RAW files for all the major brands via updates shortly after a model is released. They still have to be processed and converted before editing and later saved as a separate file, but the process is smoother.

What’s The Big Difference?

Viewing:

JPEGs can be previewed or viewed by just about everything that views pictures. I can’t think of an electronic device with a screen that can’t open and display one. (I’m sure there is some obscure device or program that doesn’t, so please hold the email.)

RAW needs to be converted to display the full-size image. Most organizing software, including Lightroom and even the ancient Picasa support on-the-fly conversion of most formats. Many, but not all viewing devices support reduced-resolution viewing using the embedded image in supported formats. When a new RAW format appears, it sometimes takes a bit for the third-party viewers to be updated if the change is significant.

Editing:

JPEG – As explained in my other article, JPEG is a compressed image. this means that the image information is processed through an algorithm that combines pixels with the same values to save space (“X-Fine” setting for instance). As compression is dialed up (“Fine”, “Standard” or “Low”), “same” values become “similar” values and data is discarded in the process. This sounds horrific from a quality standpoint but in reality the impact of moderate compression is undetectable. The real issue with JPEG is caused by the nature of the format. When a JPEG is edited, no matter whether it’s an exposure adjustment or major manipulation, when it is processed during a save, the algorithm runs again and combines “similar” values again. Values made similar by a previous save (or the creation of the file) may be further combined, discarding more image data. Again, this sounds frightening but the net effect is small at low compression levels. If you edit and re-save an image at high compression (for web or email) several times, this becomes a real issue with the image looking more and more like a four-color poster.

RAW – As mentioned before, you can’t truly edit RAW files so the image stored in the file remains pristine. Changes to the settings like noise reduction, exposure adjustment and color balance can be saved to most RAW files but the basic image remains untouched. This is also a minor issue. If you want to go past adjustments and edit an image to remove spots, wrinkles or drunk uncle Carl, you need to convert the file to an editable format and save to a separate file when done editing. If you want to post an image to a website or email it, you have to save it to a separate file in a viewable format, usually JPEG. Working with RAW, especially if you bring a couple thousand images back from vacation, can be a tedious, time consuming process. (made much easier with modern workflow software like Lightroom) The shiny side is that if you need to re-do an edit or adjustment, the original file is pristine and you can make a new copy to work on.

Advantages:

JPEG – Ubiquitous. JPEG works with everything. Nearly every computer program supports it in some way. I can’t name a mainstream software package that doesn’t allow you to embed one in a document, spreadsheet or presentation. You can email JPEGs, send them with a SMS text message, print them from a memory card at a Kiosk or many home printer or load them from a wi-fi connection on your camera directly to a website.

Standardization. Everybody plays with the same rulebook. Software can be optimized for speed because it will work on any JPEG file.

Size matters too. even a fine JPEG is one half to one third the size of a RAW file. That meant more in the early days of digital when storage was expensive. It still matters if you have tens of thousands of images, especially if you use online storage that charges by volume.

RAW – Color depth. This is RAWs biggest advantage. Images store color and brightness levels per pixel and the amount of data per pixel is referred to as “depth”. JPEG format stores 8 bits of data per channel meaning that each of the 4 channels: Red, Blue, Green and luminance (brightness) can support 256 levels for a total of 16.7million possible colors. Most camera sensors capture 10-12 bits per channel with some as high as 16. A 12-bit RAW file will store 4096 levels per channel for a total of 67 billion colors (with a “b”). This can result in smoother gradients between tones and preserves more details in shadows and bright areas that could come in handy if the shot is over- or underexposed.

Flexibility. All of those settings you adjust on the camera (other than shutter, aperture and ISO) doesn’t really affect what or how much data the camera captures. They are stored in the RAW file for reference only. When you load a RAW file into an editor the camera settings are applied but can be changed as if you were re-shooting the image with the new settings. Pretty handy if you want to adjust white balance or exposure compensation after the fact. The file also stores and makes available the more obscure settings from deep in the menus like saturation, sharpening and contrast.

Note: I shoot mostly JPEG but I used RAW files to play with the obscure menu settings to tune the test images to where I wanted them. I then changed the settings in my camera to match. The result was vastly improved JPEGs over the default settings.

Stability and continuity. The base image in the file is never changed. It is like a film negative in that it needs to be developed each time you make a “print” leaving the original untouched.

Disadvantages:

JPEG – Lossy compression. Each subsequent save recalculates similar pixels, combines the pixel-level data and discards some.

Limited color depth. the format was established for 8-bit color and so it remains. (More on this later.)

RAW – Proprietary. RAW file formats are different for each manufacturer and vary from model to model from the same manufacturer. Software needs constant updates as new cameras are released.

Obsolescence. Not much of a problem yet as new formats are added to the growing list and old ones are retained. Concerns about obsolescence were greater when RAW was fairly new so Adobe launched a universal RAW format back around 2005 which promised to provide all the benefits of RAW in a standard format. It has gained little traction with camera makers but Adobe’s converter is widely used by photographers to change their files to the DNG format (Digital Negative) as a hedge against software manufacturers dropping support for older formats. In my opinion, this is the smallest checkmark against RAW. If a format goes obsolete someone, somewhere, will create a converter to recover the obsolete files. Anybody remember Ami Pro?

Big. RAW files contain all of that extra info for settings, a JPEG for preview and all that bit depth. That adds up fast. The RAW files from my 12MP A700 were 18MB and the ones from my 24MP A77 run 24MB. That’s 40 images per gigabyte! JPEG-Fine files are 4MB-5MB and 7MB-8MB respectively.

What Does and Doesn’t matter

I’ll start by discussing the statements from the beginning of the article.

“Professionals only shoot RAW because the pictures come out so much better than JPEG”

False. Not even close to true. Many professionals shoot either or both depending on the subject and situation. Where lighting is mixed or unpredictable, the ability to manipulate exposure widely and adjust white balance aggressively after the fact can be very useful. Where conditions are controlled or favorable or when speed of delivery is paramount, a well shot JPEG is perfectly acceptable and based on personal experience, is indistinguishable from a processed RAW file.

“If you don’t shoot RAW your pictures will lose quality every time you open and look at them.”

Bullstuff. If every time you open and view a JPEG you click “Save” before you close it this would be true…and you would be stupid. When you open a JPEG, the software decodes the information, decompresses it and assembles the image. If you close it and move to the next file, the assembled image just goes “poof” into the ether and the file is untouched. If you opened and closed a JPEG a million times, it would retain the same quality as the first time, though your mouse button and finger might not fare as well.

“You can’t correct white balance in a JPEG, only RAW.”

False. What is true is that when the camera processes the file into a JPEG, the settings are applied and fixed in place and much of the unused color data is discarded. however, not all of the additional color data is gone and while you can’t adjust as much as with a RAW file, you can balance or correct all but the worst screw-ups. Here is a JPEG shot through a tinted bus window. Lightroom had no problem recovering the proper white balance. There are limits, but they are way beyond the simple corrections the average user needs when putting a shine on everyday photos.

“RAW colors are so much richer because the file has more bits per pixel.”

True. With a caveat. While RAW files can contain billions of colors and a JPEG is limited to 16.7 million, the human eye can only discern somewhere around two to seven million (some estimates put it as low as 100k and as high as 10m). Add the fact that RAW files are usually converted to JPEG for viewing or distribution and most monitors and printers are limited to 8 bits just like JPEG, the additional colors and luminance data really can’t be seen. When you have a problem image and need to make extensive adjustments to exposure, color balance or really need to recover detail in shadows or highlights, then that extra bit depth can be very useful when it is shifted into the “seeable” range during adjustment.

Another point to consider is that the “richer” colors you see from RAW files were probably seen on a website where they are posted as JPEGs and viewed on an 8-bit monitor. Any richness perceived is likely due to the skill of the person processing the file.

“RAW images never degrade when you edit them. JPEGs lose data every time you edit and save them.”

True. Covered above in advantages and disadvantages. A point that is not usually mentioned in these comparisons is that you never really edit a RAW file and there is no law saying you must edit a JPEG file. If you make a copy of a JPEG and edit the copy, the original file remains pristine. If you make a small adjustment on an original and save it at the minimum compression setting, the impact is just slightly above none. If you make a bunch of adjustments and manipulate the image extensively but only save when you are done, there is the same minimal impact. Programs like Lightroom and Picasa (some still use it!) can make virtual adjustments on a JPEG with exactly the same tools used on RAW files. These adjustments are recorded in a database and applied whenever the file is viewed or exported, leaving the original untouched. If you save the adjustments to the file in Picasa, it automatically saves a copy of the original to a sub-directory. The same is true if you choose Edit a Copy in Lightroom. There is also an option to edit a copy if you use Lightroom to open the file for editing in an external program like Photoshop or Elements. Changes to metadata, EXIF and tag info can be saved to a JPEG header without recompressing the image data.

As you can see, most of the worry about JPEG can be avoided with a little common sense and with modern organizational software, the workflow can be very easy.

I saved this one for last because is really doesn’t need a serious answer.

“REAL photographers only shoot RAW!”

Real poets only use fountain pens. Real authors only use typewriters. Real artists only work in oil. Real men don’t wear plaid. Don’t forget that up until pretty recently, REAL photographers only shot film!

“What should I shoot? RAW or JPEG?”

Do a search on the web and you will find a lot of quasi-religious belief systems founded on camera brands, prime vs. zoom, Photoshop vs. GIMP and, of course, RAW vs. JPEG. My personal opinion is “shoot whatever you want.” Both formats offer advantages and disadvantages. I personally shoot 95.8% JPEG (queried my photos for that) with spikes of RAW for weddings and old paid illustration work back when in-camera JPEG wasn’t as good as it is now. I decided early on to do some research and form my own opinion. Time was spent playing around to learn the limits of what can and can’t be done to rescue a bad image in both formats. I have shot many subjects with the camera set to record both JPEG and RAW and compared the post-processed RAW file to the JPEG. The bottom line is that the additional overhead of RAW in storage and processing over JPEG isn’t worth it for me. I have taken the time to tune my camera’s settings to optimize the out-of-camera JPEGs to further reduce the post-processing load. If you haven’t done a comparison in the last five years or so, you’ll find that the advances in pure processing power built into mid- to upper-range DSLRs and Mirrorless cameras have made in-camera processing of JPEGs not only blazing fast but as thorough as converting a RAW image on a PC.

My cameras also have a lot of useful functions that rely on in-camera processing like Sweep Panorama, Multi-shot Noise Reduction and in-camera HDR. These are very useful and only work when shooting JPEG.

I have friends that revel in tweaking every last pixel out of an image and they love to shoot RAW or RAW + JPEG. They spend hours tuning images and really enjoy the process. I don’t. Simple as that. You might. Also simple.

So, instead of rambling on about why I do what I do or presuming to know the ultimate answer to life, the universe and everything, I’ll end this article by advising you to take the time to try both formats and decide what is best for you. Unless you are a paid professional, the only person you really need to satisfy is right there in your nearest mirror!.

Happy shooting!