JPEG tone curves / dynamic range

By Rishi Sanyal

Our Dynamic Range measurement system involves shooting a calibrated Stouffer Step Wedge (13 stops total range) which is backlit using a daylight balanced lamp (95 CRI). A single shot of this produces a gray scale wedge from the camera's clipped white point down to black (example below). Each step of the scale is equivalent to 1/3 EV (a third of a stop), we select one step as 'middle gray' (defined as 50% luminance) and measure outwards to define the dynamic range. Hence there are 'two sides' to our results, the amount of shadow range (below middle gray) and the amount of highlight range (above middle gray).

To most people highlight range is the first thing they think about when talking about dynamic range, that is the amount of highlight detail above middle gray the camera can capture before it clips to white. Shadow range is more complicated; in our test the line on the graph stops as soon as the luminance value drops below our defined 'black point' (about 2% luminance) or the signal-to-noise ratio drops below a predefined value (where shadow detail would be swamped by noise), whichever comes first.

Note: this page features our new interactive dynamic range comparison widget. The wedges below the graph are created by our measurement system from the values read from the step wedge, the red lines indicate approximate shadow and highlight range (the dotted line indicating middle gray).

Cameras Compared

Our comparison chart shows the Sony a7S' default tone curve has a fairly typical S-curve that essentially matches that of its sibling, the a7R. Compared to the Panasonic GH4, the a7S has slightly higher contrast, evidenced by the steeper rise in brighter tones and the darker deep tones. With brighter rendering of light tones comes a smoother rolloff from near-white to clipped whites, which should yield smoother transitions to white in highlights. The Canon 5D Mark III shows an even steeper rise in brighter tones, also with a gentle rolloff to clipped whites. At its default setting, the a7S shows the darkest rendering of shadows amongst the cameras compared.

DR modes

Sony offers its 'Dynamic Range Optimizer' (DRO) modes to help deal with challenging high-contrast scenes. These modes work by boosting shadows while maintaining highlights - the opposite of the shadow-darkening behavior traditional S-shaped tone curves exhibit (e.g. 'DRO Off' curve, below). These modes can help in scenes with bright highlights, where either you or the camera have intentionally exposed to retain these highlights and, in the process, darkened midtones and shadows to the point that they need boosting. DRO offers five levels which give a progressively increasing effect, along with 'Auto' which selects the level that the camera considers most appropriate, based on the scene it's looking at.

We've shot our Stouffer wedge with the various DRO settings to get an idea of the tone curves applied in these modes. As you go from Lv1 (low) to Lv5 (high), you'll note progressively increasing shadow boosts. Glancing at the chart below you'll notice that all of the a7S' dynamic range modes clip highlights at the same point - which isn't a surprise, since the camera doesn't make any change to the exposure. That matches up with our real-world findings, demonstrated in the rollover below the charts. Highlights at the very top of the range are left untouched. The DRO modes mainly affect the shadow regions of the image and pull more shadow information into the image.

The real-world example below shows DRO in action. To deal with this challenging scene, we picked an exposure that provided a pleasing rendering of sun and the sky around it. This meant underexposing a large part of the scene in order to maintain some color and tone in the bright portions of the image. Progressively higher levels of DRO increasingly brighten shadows, bringing them to usable (viewable) levels in the final JPEG. Clipped highlights in the scene remain untouched, as DRO does not apply any exposure shift. Note how DRO Level 5 applies a dramatic brightening to shadow tone, revealing detail in shadows regions that aren't visible in the images shot with the lower settings. For this scene, Auto appears to have chosen Lv4 - a reasonable choice even for this challenging scene as manufacturers generally try to avoid flat, HDR-ish renderings.

DRO Auto

*Images shot through a window. Sensor dust and reflections of lights cloned-out and JPEG re-saved at 100% quality

If you want to get the most out of a challenging scene such as this one, however, you'll want to shoot Raw and expose for the highlights (as we've done here). Take a look below at what we were able to pull out of a Raw file that got the exact same exposure as the DRO examples above:

DR modes with exposure compensation

Although Sony's DRO modes apply shadow/midtone boosting, they do so without any active adjustment of exposure to retain more highlights. What this means is that you'll want to use them in higher contrast scenes where you've intentionally underexposed to protect highlights, thereby necessitating a boost of darker image tones. In P/A/S modes (and in M mode with Auto ISO), you can ensure protection of highlights by dialing in an appropriate amount of exposure of compensation. Combining negative exposure compensation with an appropriate DRO mode allows you to get a well-exposed image with additional highlight capture.

Using our Stouffer wedge, we've tested exactly how much negative exposure compensation you can apply for any given DRO mode to still achieve a well-exposed image (that is: proper midtone brightness). You'll note that the highlight range gained at the higher DRO settings can be so extensive (up to 1.7 EV) that the highlight cutoff falls off the right side of the chart. Despite our chart not having enough highlight range to show you where the highlight cutoff occurs, you can expect to gain back in highlights whatever negative exposure shift you apply - while still maintaining proper midtone brightness.

The charts show that you can dial in 0.3 EV exposure compensation per increase in DRO mode while maintaining midtone brightness. That is: -0.3 EV for Lv1, -0.7 EV for Lv2, all the way up to -1.7 EV for Lv5. This gains you highlight detail commensurate with the amount of exposure compensation applied.

Below we demonstrate the real-world effect of manually combining exposure compensation with DRO. The results are just as the graphs above lead us to expect - the shadow lift brought by each successive DRO level does enough to compensate for each 0.3 EV reduction in exposure. This means that combining Lv5 with a level of exposure compensation that maintains proper midtone brightness, you can get an extra 1.7 EV of highlight information.


S-Log2 for stills

You'll note that in the 'DRO with Exposure Compensation' widget above, we've added an option for S-Log2 in the dropdown menu. S-Log2 is available for stills, in addition to video capture, having been included largely for the latter. S-Log2 uses a very flat tone curve to incorporate lots of dynamic range so that the footage (or JPEG) can be 'graded' in post processing to give optimal tonal response. And, as you can see, the resulting DR exceeds that of our test wedge.

Applying S-Log2 increases the minimum sensitivity from ISO 100 to ISO 3200. If these were both based on the same (base) level of hardware amplification, we'd expect the S-Log2 mode to offer 5EV more highlight dynamic range. In practice it doesn't, for two slightly obscure reasons*, but the key question is: is it useful for stills shooters?

We'd conclude that it probably isn't. Unlike a7S video users, stills shooters have the option of shooting Raw if they want to make optimal use of the camera's dynamic range. To achieve this it's much more effective to use the camera's base amplification (ISO 100), rather than the S-Log2 mode that uses additional (equivalent to approximately ISO 640 in our tests) amplification. Ultimately while you could, theoretically, use S-Log2 to capture a JPEG with extra dynamic range that can have some contrast added later, there are several technical disadvantages and no obvious workflow benefit to doing so.

*The two reasons we're not seeing a 5EV gain are: 1) at the Raw level it's using around 6X the minimum level of amplification, which is a choice we don't understand, since more dynamic range is available at lower amplification settings, and 2) our tests of the JPEG output would appear to rate the final images at ISO 1250 (they're not as bright as we'd expect of something rated as ISO 3200).