The Great RAW v JPEG Debate

RAW versus JPEG

Before getting into the debate of whether you should take your pictures in RAW format or JPEG, we should probably take a moment to discuss what these actually are.

Every digital camera can produce an image in JPEG format. JPEG stands for "Joint Photographic Experts Group" and is an algorithm for taking all the data that makes a picture (like the colour and brightness of each pixel) and compresses this data so that it takes up less space on your storage. A digital picture is just a collection of numbers: every single pixel that makes the image has a numerical value based on what colour it is. What JPEG compression does is divide the whole image into blocks of 64 pixels (a square of 8 x 8 pixels) and makes similarly coloured pixels within that block the same colour. Let's looks at a simple example. Here is a picture with very little compression applied:

Showing a gradient with very little JPEG compression

And now here is the same picture but with a lot of JPEG compression applied:


Our first picture has a smooth gradient with the colours blending nicely with each other. The second picture appears blocky and we have lost the smooth gradient. The JPEG compression in the second picture has been very aggressive and has lumped a lot of the colours together giving that blocky appearance. These blocks are called "JPEG artefacts".

So how does lumping colours together as the JPEG algorithm has done here result in a smaller file size? The idea is really simple. Each pixel in an 8 bit image is stored by it's Red, Green and Blue (RGB) value. so R0 G0, B0 is pure black, R255, G255, B255 is pure white and every other colour is something in between. Imagine we have a block of pixels each with a different RGB value:

Showing example of a block of 16 pixels

If we were to store all the individual RGB values, we need to store all the following details:

R255 G151 B0; R248 G155 B20; R218 G136 B16; R247 G166 B47;
R252 G195 B112; R224 G153 B51; R211 G136 B28; R239 G156 B35;
R220 G131 B2; R230 G144 B19; R240 G155 B31; R245 G154 B21; 
R228 G150 B37; R214 G134 B18; R250 G196 B118; R231 G145 B19

However, if we give all the pixels in the block the same RGB value:

Showing an example of 16 pixels of the same colour

Then this can be stored as:

R255 G151 B0 x 16

Which as you can see, quite obviously takes up a lot less space. Of course in reality it's a bit more complicated than but the principle is the same - it's about minimising the colour data stored. However, as we have seen, when we minimise the colour data we store, we damage the picture so as with all things in photography we have to compromise. We can decide how aggressive the JPEG compression will be and that decision will result in better or poorer quality pictures and larger or smaller file sizes.

Digital Camera's have options for how it handles JPEG files and how aggressively it applies compression. These options will be in the settings menu and will be something along the lines of Normal, Fine and perhaps Superfine and you should experiment with these settings and look at the final results to see which you are happy with (Normal will compress more the Fine). With JPEG images I just stick with the least compression and if that means larger file sizes, then so be it. I'll take quality over quantity.

There is another problem with JPEG files made by your camera. All the image data that your camera recorded as it took the picture has been converted into colour data, compressed, and any information not deemed necessary is discarded. What you are left with is, in essence, the picture the camera thinks you want. But there is another way and this is where shooting RAW comes in.

Unfortunately, not all cameras allow you to shoot RAW but many do, including compact and bridge cameras. All DSLR cameras will shoot RAW.

Let's use a cooking metaphor. I have all the ingredients to bake a cake in my kitchen cupboard: flour, sugar, butter, milk and fruit. To make the cake I have to mix them all up then bake it in the oven. Two hours later I have the final product. A JPEG image is like that final cake, all the processing has been done and that's what we're left with. A RAW file is much more like the ingredients in my kitchen cupboard, it contains everything necessary to make the cake, but it isn't a cake yet.

As we have said, when you take a picture with a digital camera, all the information about the image: the colours of each pixel, the white balance etc. is stored and this is what a RAW file is: it's the original information about that image; it hasn't been processed and it hasn't been compressed, it's not even an image at all at the initial stage and without post-processing software you won't be able to view it on your computer (some RAW files contain a JPEG version of the image and any thumbnails you can see on your computer are from that JPEG, not from the RAW data itself).

All the popular post-processing software applications will read most RAW files and these software companies work hard to reverse engineer RAW files to ensure they can be interpreted by the software. It should come as no surprise that every camera manufacturer uses a different type of RAW file but regardless of the camera and software you use, the files are dealt with in broadly the same way. Needless to say, if you decide you are going to use RAW files you must be prepared to buy and learn to use post-processing software and this will be a steep learning curve, however, the upside is that you get to decide how the final image will look, not the camera. By using the RAW file it's possible to correct some mistakes you made when taking the picture (under or over exposing for example) even recovering data that would be completely gone in a JPEG (blown out highlights for example). The downside with using RAW files is that they take up much more space on your computer and you will end up in a cycle of always having to buy larger hard drives to store your ever increasing collection.

Having used both methods, I long ago decided I was happier using the RAW format. In almost every case the final picture was of better quality than the JPEG coming out of the camera but I've put a lot of time and effort into getting to know my post-processing software of choice.

And it's worth bearing in mind that you could always use both! It's very likely your camera will allow you to take JPEG and RAW pictures at the same time and this is a great option if you want to experiment with RAW but aren't quite ready to make the jump. As always, the final decision is up to you but hopefully I've provided enough basic information here to allow you to understand what JPEG and RAW formats actually are, and the upsides and downsides of both, to allow you to make an educated choice. 


Popular Posts