Why do RAW images look worse than JPEGs in editing programs?

  • I've found that when you load a RAW image into an editing program such as Lightroom/Aperture, the image is usually worse than if you just took the image as JPEG. Now I understand that the camera does some magic during the JPEG conversion. But I'm trying to understand what that "magic" is.

    If I'm looking to implement that "magic" myself on the desktop, what kind of settings should I be trying? I find that the RAW files have more extreme contrast. The dark areas for example are way darker than JPEG. Why is this? And what is the best way to fix this?

    If you are using a Nikon camera, check whether Active D-Lighting is on (and turn it off when shooting RAW). This setting will affect the previews the camera generates, but not the RAW file itself. The result will be a mismatch between the camera's preview and the desktop RAW converter's result (which will look darker, especially in the shadows). (To achieve what ADL does when shooting RAW, underexpose, then brighten up the shadows in the desktop RAW converter.)

    I had the same issue. A couple of months ago my raw files became too dark and had way too contrast. I didn't had this issue before, so I started figuring out what change might have caused this. I know much less than previous commenters about it's theoretical side, but on a practical term, switching Active D-Lightning off solved the issue.

    The image from the Raw data is not "worse" it is all of the data that the camera collected without the camera doing any bad magic to it. Some people are OK with letting the camera performance bad magic on their images, I am not. I prefer to apply my own magic.

  • A JPEG from a camera is simply a RAW image that has had some additional processing applied.

    When viewing a RAW image in an image editing program, that program has to go through exactly the same steps as the camera did.

    If there is any difference in appearance, it is only due to differences in the following (in very rough order from most to least important).

    1. Contrast / Gamma correction

      Gamma correction is applied which converts from the linear values to gamma corrected values as required by digital image files. This correction is not a straight gamma correction; a contrast curve is applied to ensure that highlights and blacks curve off nicely. Some cameras store the camera's contrast setting in the RAW file and some RAW editors can use this; otherwise RAW editors will use an in-built contrast curve. This can create quite a noticeable difference between the in-camera JPEG and an equivalent RAW viewed in an image editor. The contrast curve affects not only the appearance of contrast but also, indirectly, the colour saturation. The great thing about working with a RAW file is that you have full control over the contrast curve applied in software, before lossy operations such as sharpening, noise removal or JPEG compression have to take place.

    2. White balance

      White balance correction is applied to correct for different colour temperatures of light sources while taking the picture. Some cameras store the camera's white balance setting in the RAW file and some RAW editors can use this; otherwise RAW editors will guess the correct white balance to apply. This can create quite a noticeable difference between the in-camera JPEG and an equivalent RAW viewed in an image editor. Again, this can also be viewed as a benefit of editing in RAW, in that you are free to re-set the white balance without any lossy artefacts.

    3. Sharpening and noise reduction

      An appropriate amount of sharpening and noise reduction are applied to enhance the image and try to suppress annoying noise. 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. Differences in the sharpening and noise reduction between that the camera uses and that a RAW image editor uses could create a small difference in the appearance of an image.

    4. Colour space conversion

      Red, green and blue in the Bayer filter are not necessarily the same hue as red, green and blue in the standard sRGB colour space. The camera does colour correction to convert the colours into the desired colour space, which is usually sRGB. If you an equivalent image in a RAW image editor, it will also do colour space conversion, but it may use a different colour matrix for the conversion due to the manufacturer of the RAW editing software not having access to the same colour matrices used in the camera. If your RAW editing software is correctly configured, this step should not cause any noticeable difference in the resulting picture. Those who know what to look for (for example, Canon or Adobe's signature colour profiles, which try to enhance skin tones and blues) may be able to notice the difference especially when testing.

    5. Demosaicing

      A RAW image does not store colour values for every pixel - instead each value is either a red, green or blue value. 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, it will use its own algorithm. The demosaicing algorithm used is not a huge contributor to overall image quality, but can affect its sharpness, the degree to which it shows aliasing artefacts, and whether it throws away the edges of the image.

    6. JPEG compression

      For a JPEG image produced by a camera, the resulting image data is compressed as a JPEG. This is also, obviously, a lossy procedure and can make a difference when comparing it to a RAW image viewed in an image editor, though in most cases the difference shouldn't be noticeable.

    In summary, the biggest points of difference between the JPEG produced by the camera and an equivalent RAW produced in an image editor are likely to be caused by:

    • Different white balance in both
    • Different contrast curve / contrast adjustment in both

    Great info, but in summary, what you are saying is the reason why I'm constantly seeing a darker image in Aperture than jpegs from my camera is because Aperture chooses to use a steeper contrast curve when converting RAW than my camera?

    That sounds like it's the case. It could also be a difference in the colour space conversion. If the white point is different then it could be colour space conversion. If the white point is the same but midtones and shadows are darker it could be the contrast curve used.

    Very well said...The only "magic" is that when you shoot in jpeg, the camera itself will automatically set all the settings mentioned above. But when you shoot in raw, all these settings is left for you to do it yourself.

    Verey interesting explanation. Just for the record for any new user reading it. This explanation is for how the images *look*. But there are important diferences in the amount of information inside the file. - A raw image has more information that the monitor screen can not "see" (bit depth), so it has to be reintepreted.

    The gamma correction is what throws away most of that additional bit depth, and that is necessary when displaying on any screen, so once you've locked in the exposure, white point, contrast curve, etc and you apply that transform, your added bit depth is gone - *however* you can preserve it somewhat by using a 16 bits per channel (or better) output image format and ensuring the whole thing is done in that precision, which will allow you some more manipulation in smooth areas such as sky without introducing banding.

    Lens correction/distortion correction can also vary from one raw converter to another. Both in terms of whether it is "on" or "off' by default or the exact amount/shape/type of correction applied.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM