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.
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.