Yesterday’s Topic: Rules Of Thirds
Most every post you see on JPEG and RAW file formats pits them against each other; RAW Vs. JPEG In A Cage Match To The Death!! You’ll also hear a number of experts tell you you have to shoot in RAW or you suck. The funny thing is, those experts don’t know how you shoot. They know how they shoot and what works for them. Bravo be to thee, but don’t make me fit into their world, please.
I’m hear to tell you you can shoot in either JPEG or RAW and life will, in fact, go on. Heck, you might even be happy. But first, let me arm you with some information to make your own decision.
Jargon time: RAW is as it sounds. It is raw information from your camera’s sensor. JPEG is an acronym you will never remember so don’t sweat the small stuff. It is a type of compression to take all that raw information and squish it down. In the post How Your Camera Works I mentioned the use of a buffer because most cameras can shoot faster than they can write the photo information to the memory card. JPEG helps alleviate that (and can do away with the wait altogether) by smooshing down that huge RAW file size from something like 20MB to maybe 5MB. Impressive, huh? It comes at a price, though.
Let’s look at this visually using the diagram of the image sensor inside your camera from the ISO post.

Each of those spots is a sensor set to detect only the amount of light hitting it of the appropriate color. This part is no exaggeration; that green dot only sees levels of green, the red only red and blue only blue. That’s it, just those three colors. (Note: hip new sensors will bend this rule around, but the idea is the same.) RAW format is set to record the data from each and every pixel. To make the math easy I am going to exaggerate a bit. If a sensor has 20 megapixels (million pixels) and each pixel’s information is roughly one byte, that would be 20 megabytes of data (technically it is 1,048,576 bytes to a megabyte, but let’s round numbers to annoy geeks). 20MB. A decent sized file. I’ll illustrate this in a minute.
What JPEG does to compress this 20MB of information is to group pixels together and write not individual pixel bytes, but the combined numbers which equal a color. The sensor pixels in most cameras are set to record 256, 4,096 or 16,384 different tones of just each color. That is, in 8bit mode, there can be 256 different intensities of red recorded in each red pixel. 12bit sensors go up to 4,096 different intensities and 14bit is 16,384 different intensities. Sorry if I’m getting techy, but if you want to go further, Canon has some good info.
Let’s keep it simple and go 8bit. Red, green, blue, otherwise known as RGB, are the primary colors and they are combined in various ratios to represent all colors. So pick a trio of pixels above in each color. The true color of the light hitting the sensor, let’s say a nice purple, might be represented with intensities listed like this: Red: 99 Green: 21 Blue: 108. It’s just like mixing paint in an art class or at the home improvement store. Add in certain quantities of each primary color and voila! A new color. Yay!
The RAW file would have recorded each and every pixel just as its R or G or B value, individually (and then put in zeros for the other colors, such as R:99 G:0 B:0). Thus its bigness. JPEG will take those three pixels’ information and only record the final number that they all make up. It’s diagram time. First let me show how the information for a RAW file will be recorded. I’m going to overlay some color that looks like this:

That purple, as expressed in RGB is R:131 G:53 B:163 and the orange is R:217 G:124 B:25. Does that make sense? Just remember: mixing different amounts of paint. Now I’ll make it slightly transparent and lay it over the sensor grid.

Next I will fill in the appropriate date each individual pixel will see. Remember, each pixel can only see its own color in a varying degree of intensity. I am using close, actual numbers here in a R G B, top to bottom format.

Mesmerizing, isn’t it? Do you see how I got each of those numbers? Purple is made up of 131 parts Red, 53 parts Green and 163 parts Blue. A green sensor can only record green values, so it puts a zero for the red and blue placeholders. While they are zeros, they still take up space to record. In RAW recording mode, this information is passed on to the file just as it is seen here (how it is viewed on the computer afterward is another story).
JPEG is going to cheat a bit. Its information will look like this (don’t mind the difference in triangle colors, they are only different to make them easier to see):

I’m not going to fill in the entire grid for sanity’s sake. And this drawing is not 100% accurate in the way the compression actually gets done, for the tech geeks out there. It’s a representation of how the process works. In essence, the amount of data, over all, has been reduced and further algorithms in the camera will compress this a bit further. The real import of this information will become more apparent tomorrow when I go over White Balance.
For now, just understand that JPEG gives up some of the original light information when it does its compression. In the example above, where two colors slightly cover the three sensors (the yellow triangle) what happens to the original information about the blue pixel in that group? Look above, it was 0,0,25 but now, because it is being combined with a bit of the sensors where purple is striking, it gets adjusted in the end compromise to shrink. That true color, the amount of blue that hit that pixel, is lost when compressed. That’s why JPEG is known as a lossy (as compared to loss-less) format. Not all the original data is transferred.
Which File Format To Use?
Now that your brain and mine are fried by the math aspect, how does this apply to my original statement of “Use what you want”?
Simple; If you always want all the image data to have maximum ability to fiddle with it in the computer, go RAW.
JPEG, on the other hand, is valuable for certain situations:
- When you just don’t care
- Shooting for speed if you keep hitting a full buffer
- If you need to conserve space on a nearly full card while out in the tropics away from Walmarts
- If you don’t want to fiddle with RAW files in a computer afterward and just want to post them to Facebook quickly
- You hate large files and the time it takes to transfer them to your computer
RAW isn’t as easy to just shoot and then email to a friend. It has to be converted first to, often, JPEG for emailing. Lucky for us, cameras now have the ability to shoot in both JPEG+RAW at the same time! I do this often when traveling and I know I want to quickly post sample images. I will shoot in the smallest image size for the JPEG version and that makes a nice small file easy to post or email without the need to convert it, while realizing that the RAW file will contain all the data and I can make adjustments in the computer more eloquently later at home.
DANGER: We will get into White Balance tomorrow, but for now I will warn you that White Balance is set and written into the JPEG file when it is created (as well as some other items). You can’t change this back easily. But RAW does allow for easy White Balance changes. Super easy in the computer, as a matter of fact. Intrigued? Tune in tomorrow!
DOUBLE DANGER: Every time you save a JPEG file in a computer (or even rotate it) your computer will compress it again. Meaning it will degrade just a bit every time you play with it.
Compression Options
Lastly, I get asked about the different compression settings. These typically look like (Nikon)”Basic, Normal, Fine” or (Canon)”Normal, Fine, Super Fine”. Those levels represent how much compression happens to the file. Staring from the top of both, Fine and Super Fine start with triangles that look like the diagram above; nice and small and the most detail that can be obtained. As you move to Normal and Fine, respectively, the triangles will get bigger. Now instead taking three pixels and combining their data, the triangle will suck up six (and there will be a funky type of overlap) and the file size will get smaller still. But guess what? Even more finite data is lost because the triangle will average the color inside of it and that will change the larger it becomes. Finally, in Basic and Normal, the triangle is larger still, the file smaller and the picture not as sharp.
My suggestion, go with the highest compression you can (Fine and Super Fine, respectively) unless you are just about out of space on your card with no secondary card available.
In closing, realize people typically migrate towards RAW from JPEG as they get more comfortable with post-processing (playing with the image in the computer afterward). I would never tell my Dad, for instance, to shoot in RAW. He really has no reason to for the types of images he shoots and doesn’t like having to mess with pictures in a computer afterward. Many people start with JPEG because they know how to handle it and then as they want more control over editing the image in the computer, they start to see the clear advantage RAW possesses by being able to present all the original, unedited information when the shot was taken.
One last thing: If you want to take this a step further, check out Jim Goldstein’s post on the DNG file format (used in the computer after import) to expand your knowledge. He also has some more info on the JPEG and RAW conversation with a list of Pros and Cons. I suspect Jim is himself a con running from the law, posing as a mild mannered photographer.
Next Up: Quick Exposure Adjustments
31 Days To Better Photography is a series written by professional photographer Peter West Carey on The Carey Adventures.Com. The series is designed to unravel the mysteries of photography so you can take better pictures. Subscribe here to receive all the updates and bonus material. Your comments are always welcome.











Thanks for making my head explode first thing in the morning Peter, that usually doesn’t happen until I hear from my ex… ;)
FWIW, the way I usually explain it is JPRG is a Polaroid, you can’t do anything with it once it’s in your hands, RAW is a negative, you can do anything you want with it, change the exposure, white balance etc..
Ron
Good analogy, Ron.
very nice post, I appreciate your explanations.
Thanks!
Very helpful and succinctly written. Now I’m looking forward to reading the rest of your articles and setting forth on my next outing as a better informed, if not actually a better, photographer. :)
This series (and topics) was a brilliant idea! Your explanation of the compression and jpeg/raw technology was great. Thanks for all of this. I am looking forward to the future topics.
Love this simple explanation for the non-techie. and what, no bunny?
If you got bunnies with very post, you would start to discount them. No bunny should ever be discounted. Not past 10%, at least.
Hi Peter, I shoot Jpeg because I take zillions of stock photographs and any that aren’t perfect go straight into the recycle bin. I don’t have time to mess with images, unless it’s something really, really, special, like a bunny. However, tiff is non lossy too, right? What I do is convert my Jpegs to Tiffs as soon as I download them, tweak them as tiffs in Photoshop (contrast etc), and then convert them to Jpegs when they are ready (saving the tiff originals of course). Any comments on this process? I just seem to be able to work with images better as tiffs and jpegs than RAWs.
George,
The problem is you’re going from something that is already compressed so taking it to a TIFF doesn’t help much. Inside of photoshop, until you save, there is no loss. Further, you can save space by opening the JPEG and saving as a PSD (lossless) and then editing and exporting if you are worried. PSD should be less space than TIFF.
I’d suggest shooting as RAW and then importing into Photo shop via Adobe Bridge. You then can play with the lossless PSD (or TIFF if you choose) and will have more latitude than starting with a JPG.
Thanks Peter, I’m experimenting with RAWs. The older you get the more resistant to seem to become to change ;)
I shoot in raw format but as soon as I make any changes (like rotating or changing to black and white) the image becomes a jpeg. Is this normal?
The files usually go from 6mb down to 2.5 mb. Is there a program to use that keeps the files larger?
Does this change the quality of the images when I finally go to print them?
Amy
Are you talking about making changes in your computer? Which program are you using?
There are many programs that keep using the file as a RAW file, such as Lightroom and I think Picasa does, but haven’t actually checked for that.
As for printing, you have to save out of RAW to print. Depending on the printer, DNG or TIFF files will contain the most information. JPEG is an accepted standard for most printers just remember to only save to it ONCE per file to get the highest quality. Make all your changes in a program that allows for lossless editing and then save out to JPEG for printing.
Thank you so much for this Ron! I’m learning so much thanks to you, I really really appreciate this. You’re funny and an EXCELLENT teacher!
Very helpful tutorial, and didnt over complicate or technicalise!
Thanks