When I review phones and cameras, I often mention whether or not the device is capable of taking pictures in RAW format. So, what is RAW? Should you insist on having it as a feature? Should you use it? What advantages does it have, if any, over the good old JPEG files your camera and phone normally produce? And what disadvantages?
To help talk about these things I’m mostly going to use as an example a photo taken on a smart phone – a Samsung Galaxy S7. This has one of the best cameras around … for a smart phone. You will likely be startled by the differences between the RAW and JPEG format photos it produces. As we’ll see, the differences are less stark with standalone digital cameras. The better the camera, the smaller the difference.
Two sets of processing
There are two principal differences between JPEG and RAW photos. The latter is what you might call the raw material used by the processing in the camera to create the JPEG. If you save a RAW image, you are simply plucking the image out of an earlier stage in the picture creation process.
And you’re stopping the “lossy” JPEG compression process.
There are two main sets of image processing that go on inside your digital camera/phone camera. The first set is concerned with simply getting the raw image data in the first place. The output from the image sensor has to be adjusted so that it accurately tracks the brightness to darkness scales for each colour. That becomes the raw material. And if your device supports RAW photography, then that’s probably what will be saved.
But almost all photos then go through additional digital processing which is designed to improve the image. This involves things like tweaking the colour and contrast levels and enhancing picture detail. The better the basic optics and sensor, the less of this kind of processing that is required.
Finally, the image is compressed using JPEG. How much compression is a design decision. Too much can lead to visible compression artefacts. Too little can result in excessively large file sizes. It is, after all, to reduce the size of the files that JPEG compression is used at all.
Most cameras and phones which support RAW files will actually save two copies of the picture: one in RAW and one processed in the usual way and saved as JPEG. The photo I’m going to use here was 4.08MB in its JPEG form, and 23.8MB in RAW. In practice, JPEG files sizes tend to be all over the place in size because how effective JPEG compression is depends very much upon the content. The photos I on the same day as the example photo range in size from 2.90MB to 5.20MB in JPEG. In RAW they are all 23.8MB. The RAW file consists of the original photo, and possibly some metadata and a small JPEG preview. The Samsung Galaxy S7, for example, embeds a 504 by 376 pixel JPEG preview. This shows up in Windows Explorer, making it easier to manage these pictures because you can see what they are without having to open them in suitable image processing software.
You will need specialised software to do anything with RAW images. A lot of image software won’t open them at all. I use Photoshop, which does. The files are usually named the same as their JPEG versions, but with a different file extension indicating the format. Not all RAW formats are the same, and not all extensions are the same. For example, RAW pictures taken with Samsung and HTC phones have .dng file names. While those taken with Panasonic cameras have .rw2 file names.
So, how different are the original and the processed versions? As I keep saying, it depends on the camera. Here is a shot I took using the Panasonic Lumix DC-GH5 (pictured at top) earlier this year, cropped way down so you can see how sharp it was. The left side is from the RAW image. The right from the JPEG image that camera made from that. Not a whole lot of difference. The camera has applied a little sharpening or detail enhancement. The colours have shifted a little, although that doesn’t show up all that clearly because the RAW image actually used a different colour profile, and when I pasted one image into the other, the same profile was required for both.
Still, all in all, the differences are subtle.
Now let’s repeat that with the Samsung Galaxy S7 which, I stress, has one of the better phone cameras around. Here’s the RAW version:
And here’s what you get on the exact, same picture when it’s processed by the phone and saved as JPEG:
Not too much difference by the look of it. The contrast is deeper on the processed version, the blue of the sky is richer and it looks just a little sharper. But that’s deceptive, because I’ve scaled these photos down from their original 4032 pixels wide to just 760, so they fit neatly on this page. Let’s zoom in and crop the two pictures down to 760 pixels wide.
Whoah! Now we can see significant differences. The display resolution on these is the same as the Panasonic example above. You can see how much harder the Samsung phone worked on this image. Which do you prefer? Most people will naturally prefer the processed version. And I do, overall, although I remain a little ambivalent.
The colour and contrast enhancements make for a bolder, more attractive image. But I think the colour of the greenery is actually more accurate in the RAW version. My main problem with the processed version, though, is the sharpening or detail enhancement. The Samsung phone has applied gobs of it. A huge amount. When I tried to replicate it in Photoshop, I feel I still fell short using 100% sharpening with a radius of two pixels in the Unsharp Mask filter.
Whether the sharpening improves or damages the image depends on where you look. The water in the foreground looks better in the processed version, as does the rockwork on the bridge tower and stone wall at the water’s edge. But the foliage of the trees looks blocky and artificial in the processed picture, and there’s actually a loss of detail in some of the metal work of the bridge.
Here, for example we have a detail of the bridge blown up to 300%, with the RAW to the left. Look at the little tower at top left of each. See how more finely etched its lines are. See the fence to its right. There are two horizontal lines at its top. In the processed version they mushed together. Notice the whitish halo around the flag and the tower in the processed version. They are artefacts of sharpening.
And I can’t escape the sense that the foliage of the tree seems so much more real in the original than in the processed version. Note, also, how there must have been some small red thing in the tree which has been completely lost in the “improved” picture.
But that does tend to be a Samsung thing. Whether phones or TVs, it does seem to like applying lots of picture sharpening. I wish there were a way of adjusting that setting for the standard JPEG pictures.