Alley in Pisa, Italy

by Lars Kotthoff

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

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?

share|improve this question
1  
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.) –  Szabolcs Jul 29 '13 at 21:42
add comment

3 Answers 3

up vote 4 down vote accepted

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
share|improve this answer
    
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? –  erotsppa Jul 30 '13 at 16:00
    
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. –  thomasrutter Jul 31 '13 at 1:26
    
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. –  Jez'r 570 Aug 2 '13 at 6:56
add comment

There's no "magic" it's just that different raw processors have different default behaviors (and different algorithms, etc.).

You can see there's no magic using the camera manufacturer's own raw processor (for example, if your camera is a Canon use DPP) - this should give you exactly the same image has the in-camera processor.

I don't know about Aperture but Lightroom can duplicate the in-camera processing, just scroll down to the "Camera Calibration" section and change the "Profile" from "Adobe Standard" to "Camera Standard" (if you use the camera's "Standard" picture style, otherwise choose the setting that matches the picture style you use in-camera).

share|improve this answer
1  
Be aware that at least with Canon, the demosaicing algorithms are proprietary, and any "presets" written to simulate Canon's own conversion algorithms by third party products such as Lightroom are at best reverse-engineered guesses. They may get close, but they won't be exactly the same. –  Michael Clark Jul 29 '13 at 22:19
    
Yeah I think this is it. If your camera can produce a pleasing image, it's doing it based on the RAW data, there's no other way it can be done. So, it is possible to get the image the way you want it, but your RAW processor isn't doing that - you have to find the right settings. The only time I've experienced this is when I took some really bad shots though - the JPG looked ok, but the RAW file was super-noisy. That was my mistake - shooting at F/22 and 'high ISO' on a dark day. –  Jasmine Jul 29 '13 at 22:31
    
@MichaelClark: I think you've got that wrong...last I knew, Canon offered an SDK that contained their exact demosaicing algorithms and picture styles. The problem is that Adobe simply refuses to use or reference Canon's SDK (I suspect because of some inane ruling by their legal department, not for any other "real" reason...) –  jrista Jul 30 '13 at 3:53
    
If they have it has been fairly recently. The RAW data is still encrypted in .cr2 files. The SDK has always allowed developers to write code that interfaces with the camera's OS and allows transport of .cr2 files, but AFAIK in the past has never contained the demosaicing algorithms for .cr2 files. –  Michael Clark Jul 30 '13 at 4:58
    
There have been other parties who have cracked the encryption scheme used in .cr2 files but they were not authorized by Canon to do so, and software companies like Adobe And DxO Labs are still reverse engineering their own algorithms. Several years ago Nikon released their demosaicing algorithms to DxO for use in testing Nikon sensors. –  Michael Clark Jul 30 '13 at 5:02
add comment

Most in-camera jpeg engines increase contrast, saturation, and add some sharpening into the mix. Depending on what camera you use to produce your RAW files and what software you open them with on your computer, sometimes those in-camera settings are also applied to the RAW file when it is displayed. Of course you are not actually viewing the RAW file on your screen; you are almost certainly viewing an 8-bit conversion of that RAW file which is similar to an 8-bit jpeg.

If you are using a Canon camera and open the .cr2 files using Digital Photo Professional (DPP) the in-camera settings selected at the time the image was shot will be applied to the preview image on your screen. Most other manufacturer's in house software does the same thing. Most third party RAW conversion software, such as Lightroom or DxO Optics, do not apply the in camera settings. Some of them will allow you to build a custom profile to apply to each image as it is imported or opened.

The first thing I would recommend regarding the dark areas of your images is to confirm that your monitor is properly calibrated. The best way is to use a calibration tool that reads a test output from your screen and uses bundled software to create a profile for your monitor. A cheaper and less accurate way is to use test patterns to visually adjust your monitor's or video card's settings. Quick Gamma is one such tool. Once you know your monitor is adjusted properly, then you can use the tone curve tool in the RAW convertor of your choice to bring up the shadows.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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