4

I knew of the practical advantages of RAW over JPEG even before I searched the site and found what seems to be the canonical question. Yes, the processed images look better.

But when I tried to explain to a non-photographer why it is better, I dived into murky theoretical waters I'm not too familiar with. The ones I could explain properly were the role of bit depth and compression artefacts; the one I skipped but know is important was the role of matrices and proper demosaic. And, of course, existing camera firmware and processing software supports RAW, not 12-bit bitmaps.

So, are there any other reasons why one can get more out of a RAW image than out of a JPEG? Or would there have been no reason for postprocessing RAW if we were working with 12-bit bitmaps with losless compression?

8

The main advantage with RAW is that several of the camera's lossy processing steps such as sharpening, noise reduction and demosaicing are not yet "burned in" to the image file, allowing you to choose the algorithm later in software, and re-adjust it as many times as you like with different settings, without the generational loss associated with applying further processing to an already-processed image.

For a more technical description, see my answer to What is RAW, technically?.

Here is a list of things you have more control over in software later, if you shoot RAW:

  1. Contrast / Gamma correction

    This is also where the bit depth advantage - as mentioned by the question - comes in. Linear values need to be converted to gamma-corrected values to work as an image file, and if you re-do this later you get banding. Going back to the raw data enables you to re-adjust the contrast curve without introducing additional banding.

  2. White balance and colour space conversion

    If you re-do colour balance to a raster image, you can also potentially get banding or even clipping, so doing it in the RAW software can apply it based on the original raw values, along with the contrast curve (above).

  3. Sharpening and noise reduction

    There are different sharpening and noise reduction algorithms, and this is a lossy procedure. If this is done in-camera, then you are stuck with whatever sharpening and noise reduction was applied by the camera. A RAW image editor can adjust these values without the generational loss associated with applying a further sharpening or smoothing to an already-processed image. Doing it in the RAW software may also give you the opportunity of using different sharpening and noise reduction algorithms or adjusting more of their parameters.

  4. Demosaicing

    A RAW image does not store colour values for every pixel - instead each value is a monochromatic value measured from behind one of three colored filters in a Bayer array. However, you need each pixel to have all three colours - red, green and blue - for the final image. Therefore, a demosaicing algorithm has to guess the other two colour parts for each pixels, and it does this based on knowledge of surrounding pixels. There are a variety of different demosaicing algorithms with varying qualities, and it is a lossy process. If this occurs in-camera, then you are stuck with the camera's built-in algorithm. If you use a RAW image editor, you may be able to use a smarter algorithm, and you may have control over the algorithm used. This can affect its sharpness, the degree to which it shows aliasing artefacts, and whether it throws away the edges of the image.

  5. JPEG compression

    Of course - if you are comparing RAW to JPEG, with RAW you're not dealing with an image that has JPEG compression artifacts - even before you start post-processing.

  • 1
    What most of those really boil down to is that a bitmap is an integer representation, and converting it to integer values requires rounding. If, instead of a RAW file, your camera did all of its processing and wrote each pixel's value as 3-tuple of 32-bit (or larger) floating-point values, there would not be much advantage to having the RAW files, because you should be able to reverse the math and get roughly the original RAW values. Of course, those files would be about 12 times the size of the original RAW file, so it wouldn't make sense to do that, but in theory.... :-) – dgatwood Aug 22 '18 at 23:06
  • 1
    dgatwood : I don't consider "Linear DNG" to be RAW file but it's pretty much what you are describing barrypearson.co.uk/articles/dng/linear.htm – skyde Aug 22 '18 at 23:34
  • 1
    @dgatwood, a lossless 32-bit bitmap would still not be reversible back to the RAW file because the demosaicing is a lossy operation, it involves some smart guessing on the part of the algorithm and you can't go back to the raw data after it. In addition, any color space conversion, curves/gamma and so on could theoretically be reversed but only if you had the original lookup tables. This is the case with "linear DNG" as well, as that has had demosaicing applied. – thomasrutter Aug 22 '18 at 23:58
1

thomasrutter gave a really good answer, but there is one other key benefit.

Image formats, and indeed current monitors can only support so many colors. Raw stores much more information. You don't see this information, but if you want to perform adjustments like contrast/exposure on your photo you will get better results from RAW.

For example, let's say that you have a luminosity scale of 0-1000, but your JPEG treats everything below 250 as "black", or 0.

If you try to lighten a dark region of a picture through some process, if you've lost all that data, you will get artifacts. Using raw, however, will allow you to recover parts of your image that appeared "black" before.

  • Doesn't this fall under "would there have been no reason for postprocessing RAW if we were working with 12-bit bitmaps with losless compression?"? – a CVn Sep 21 '13 at 20:00
  • Michael Kjörling no because a 12bit value range from 0 to 4096 and black would have been stored as value 0 inside the bitmap. so values darker than black are lost. Those value can only be preserved if we save the sensor value as 12bit instead of the result of performing level and gamma curve on the sensor 12 bit value. We could also use a format such as OpenEXR that use 16bit float and can store "out of range" value, in this case pixel darker than black would have a negative value. – skyde Aug 22 '18 at 22:19
0

As you mentioned demosaicing is a big one, demosaicing algorithm improve with each version of the raw editing software better demosaicing also give you better sharpening and noise reduction quality.

I could for example take very old raw file from a 4 year old Sony camera and open them with latest version of Capture one software and get better quality jpeg.

Another one is wide gamut colorspace, Since 2016, new Apple products (like the iPhone 7) use the wider P3 color space instead of the sRGB color space.

Picture that where saved as sRGB jpeg and had colour outside the triangle of the sRGB Primary colors had those color clipped and lost forever.

With RAW all the sensor color gamut are preserved and I can reopen old RAW file and export them as DCI-P3 jpeg instead of sRGB jpeg.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.