# Dynamic Range

Dynamic Range (DR) is the range of exposure, i.e., scene brightness, over which a camera responds with good contrast and good Signal-to-Noise Ratio (SNR).

 New in Imatest 5.2:  By default, Imatest quality-based DR is limited to the slope-based DR, so that the requirement that DR is the range of exposure with good SNR and contrast is met. This reduces the likelihood of excessive DR measurements when flare light is mistaken for real image signal. For more details, see Making Dynamic Range measurements robust against flare light.

### Sensor vs. System Dynamic Range

Sensor manufacturers are developing High Dynamic Range (HDR) image sensors that claim exceptional dynamic ranges: 120dB to as much as 150dB. Measured system (camera) dynamic range is typically much lower than the specified sensor dynamic range.

The primary cause is flare light in the lensstray light reflected between lens elements and off the barrel (on the interior of the lens) that fogs the image and sometimes causes “ghost” images. High quality lens coatings help— but only so much. Different test chart designs have different density distributions, hence have different amounts of lens flare on the chart image— leading to differences in measured dynamic range. No camera system we know of (where light has to pass through optics) reaches 120 dB. (100dB is about the best we’ve heard of (summer 2017).)

Sensor dynamic range (the range of brightness between sensor saturation and SNR = 1 (0 dB)) can be measured from absolutely raw images (no demosaicing or processing of any kind) with Color/Tone Interactive or Color/Tone Auto (formerly Multicharts and Multitest) using a technique described in Color/Tone/eSFR ISO Noise. It can also be measured with a sequence of flat field exposures (often involving calibrated neutral density filters). These measurements should not be confused with a camera or system measurements (especially for HDR systems) because the images used for the measurement has zero dynamic range, and hence don’t correspond to a real scene in a real camera.

ISO 15739:  The dynamic range corresponding Scene-referenced Signal-to-Noise Ratio SNRscene = 1 (0dB) corresponds to the intent of the ISO 15739 Dynamic range definition in section 6.3 of the ISO noise measurement standard: ISO 15739: Photography — Electronic still-picture imaging — Noise measurements. Imatest Dynamic Range differs in several details from ISO 15739 (though we do measure ISO 15739 Dynamic Range); hence the results are not identical. Imatest may well produce more accurate results because it measures DR directly from a transmission chart, rather than extrapolating results for a reflective chart with maximum density = 2.0.

 Measurement Modules Description Dynamic range from a single transmissive chart image. Stepchart, Color/Tone Interactive, Auto A transmissive chart is such as the Imatest 36-patch Dynamic Range or HDR chart is required because reflective charts do not have sufficient tonal range. Dynamic range from multiple (differently exposed) images Dynamic Range module Uses CSV output of Multitest or Stepchart from several differently-exposed images. Usually used with reflective charts, but transmissive charts may also be used. May overstate DR, especially for HDR situations, where flare light is lower than realistic cases. ISO 15739 Dynamic Range from patch with density ≈ 2 Color/Tone Interactive, Auto eSFR ISO Extrapolated Dynamic Range from a single patch with density ≈ 2. Works with single images from reflective charts. Not for HDR (High Dynamic Range) images. Raw sensor Dynamic Range Color/Tone Interactive, Auto Fits raw data to an equation from the EMVA 1288 standard, then extrapolates to find DR. The test chart does not have to have as large a tonal range as the DR, but transmissive charts with tonal range ≥ 3 are recommended. Contrast Resolution Color/Tone Interactive, Auto Measures the visibility of low contrast features over a wide tonal range. A better indication of true usable DR than traditional measurements. New in Imatest 5.0. Not yet an industry standard (as of Sept. 2017), but we’re working on it.

 Module Brief description and recommendations Color/Tone Setup (Multicharts) Interactive module for measuring color and grayscale charts. Best when you need to closely examine the results. Supports several measurements not in Stepchart, including ISO noise, sensor dynamic range, and Contrast Resolution. Multicharts and Multitest share most INI file settings. They have all Stepchart capabilities. Color/Tone Auto (Multitest) Fixed (batch-capable) module for measuring color and grayscale charts. Same functions and INI file settings as Multicharts. Largely replaces Colorcheck and Stepchart (both older modules with limited capabilities). Stepchart Older (legacy) module for measuring grayscale step charts (at first it only supported the Kodak Q13/Q14 charts).

 Quality (SNR)-based Recommended in most cases. the  range of exposure where the pixel level is below 98% of the saturation level (250 for 8-bit systems, which have a maximum of 255), and the scene-referenced Signal-to-Noise Ratio (SNRscene) is greater than a specified minimum amount (Imatest calculates DR for the four levels shown on the right). The higher the SNRscene (the lower the noise) in a region, the better the image quality. In Imatest 5.2+, by default, quality-based DR cannot be larger than slope-based DR to reduce the likelihood of false (excessive) DR measurements due to flare light. For more details, see Making Dynamic Range measurements robust against flare light. SNR tends to be worst in the darkest regions. SNRscene ≥ 10 = 20dB; high quality     SNRscene ≥  4  = 12dB medium-high quality     SNRscene ≥  2  = 6dB; medium quality     SNRscene ≥  1  = 0dB; low quality Slope-based (introduced in Imatest 4.4) (Not recommended by itself, but used in Imatest 5.2+ to limit quality-based DR) The range of exposure where slope of the density curve is greater than 7.5% of the maximum slope (on the dark side) and less than 98% of the saturation level (on the light side). This has to be done with care since noise and irregular density steps in the original data affect patch levels, and hence slope measurement. Test chart density is interpolated to have 101 evenly-spaced points, then the log pixel level for these points is found using the Matlab interp1 function. The curve is smoothed using a rectangular kernel 7 points wide (approximately 1/14 of the total range). This algorithm gives better results than earlier (pre-4.4) Patch range and detected DR measurements, but it should be interpreted with care because SNR can be extremely low (often well under 1 = 0 dB) in the the dark portion of the range. This can result in measurement inconsistencies as well as overly optimistic measurements, since no meaningful image is visible (it’s all noise) when SNR < 1. Slope-based DR can be falsely increased by tone-mapping and by medium-range flare light (bleeding from light chart patches, visible in the Image Statistics images below). For this reason WE DO NOT RECOMMEND IT. The Contrast Resolution chart and analysis provides a much better indication of true camera (system) DR.

### Image Quality Factors for Cameras and Displays

Summary table — corresponding test charts and modules

### Transmission step charts

The most straightforward way to measure a camera’s (or scanner’s) dynamic range is with a transmission step chart illuminated from behind by a lightbox (taking care to minimize light reaching the front of the chart). Reflection step charts such as the Kodak/Tiffen Q-13 or Q-14 are inadequate because their density range of around 1.9 is equivalent to 1.9 * 3.32 = 6.3 f-stops (38 dB), well below that of digital cameras (although they can be used to measure Dynamic Range from several different exposures combined in the Dynamic Range postprocessor for Multitest and Stepchart).

The table below lists several transmission step charts, all of which have a density range of at least 3 (10 f-stops). All except the Imatest, TE241, TE264, and TE269 charts are linear (one row of patches), and may suffer from vignetting (light falloff) as a result. All except the Imatest charts have dark backgrounds, which makes is difficult to achieve correct exposure in autoexposure systems.

 Product Steps Density increment Dmax Size Imatest 36-patch ITDR36 Dynamic Range test chart 36 ~0.10 (1/3 f-stop); Reference file included >2.8 8×10″ Imatest 36-patch ITWDR36 Wide Dynamic Range test chart  (recommended) 36 ~0.10 – 0.30 (1/3 – 1 f-stop); Reference file required >5 8×10″ Imatest 36-patch ITUHDR36 Ultra High Dynamic Range test chart 36 ” >7.5 8×10″ Imatest Contrast Resolution chart 20 0.25 (with 2:1 inner patches) 4.75 8×10″ Kodak Photographic Step Tablet No. 2 or 3. Calibrated or uncalibrated (usually sufficient). 21 0.15 (1/2 f-stop) Linear pattern* 3.05 1x5.5″ (#2) larger (#3) Stouffer Transmission Step Wedge T4110 41 0.10 (1/3 f-stop) Linear pattern* 4.05 1x9″ 28 0.15 (1/2 f-stop) Linear pattern* 4.2 (0.4x9″) DSC Labs Xyla 15, 21, and 26 step HDR Greyscale ≥13 0.30 ( 1 f-stop) Linear pattern* 3.7 (large) 20 36 from supplied table; 20-patch charts have large steps in dark regions. Circular pattern of squares. Most are half toned. 4−6 D280 *Region selection is less robust with linear (single-row) charts because it’s difficult to locate features in very dark areas. Also, linear charts are more subject to vignetting than charts with a circular arrangement of patches. Most transmissive dynamic range test charts require a reference file (usually with a single density value per line, but L*a*b* values also work). The only exceptions are the Stouffer T4110 and the DSC Labs Xyla charts, which have consistent density steps.

The Imatest 36-patch Wide Dynamic Range (HDR) test chart, with density steps from 0.1 to 0.3 and a maximum density of at least base+5 (~17 f-stops), is recommended for traditional Dynamic Range measurements. A nearly circular patch arrangement ensures that vignetting has minimal effect on results. A CSV or CGATS reference file with actual densities (required with the HDR chart) is supplied. the chart has an active area of 7.75×9.25 inches on 8×10 inch film.

It also contains slanted edges in the center and corners with 4:1 contrast for measuring MTF. Registration marks make the regions easy to select, and fully automated region detection is available in Imatest 4.0+. A neutral gray background helps ensure that the chart will be well-exposed in auto exposure cameras (compared to charts with black backgrounds, which are sometimes strongly overexposed).

This chart is produced with a high-precision LVT film recording process for the best possible density range, low noise, and fine detail.

The standard 36-patch Dynamic Range chart can be used with the Dynamic Range postprocessor to measure dynamic ranges larger than 11 f-stops if several manual exposures are available. Dmax = 3.4 is sufficient for camera phones and digital cameras with small pixel sizes, but high-end DSLRs and HDR security and automotive cameras generally have higher dynamic ranges, which makes them well suited for measurements with either Dynamic Range or the HDR chart (which never requires the Dynamic Range postprocessor).

### Lightbox

You’ll need a lightbox that can evenly illuminate the transmission step chart. 9×12 inches (26×22 cm) is large enough in most cases. Avoid thin or “mini” models, which may not have even enough illumination. Fluorescent light boxes should have high-frequency ballasts to eliminate flicker.

We recommend the Imatest LED Lightbox (shown on the right with the 36-patch HDR chart), available from the Imatest store. It has

• Highly uniform illumination: ~95% uniformity.
• High quality spectral response. The standard version allows you to choose between 3100K, 4100K, 5100K, 5500K, 6500K color temperature with a Color Rendering Index (CRI) of 97 and near-infrared wavelengths of 850nm and 940nm. Other color temperatures are available as options.
• Adjustable intensity via a hardware knob, WiFi, or USB from 30-10,000 lux equivalent: a range of over 300:1, making it suitable for measurements from near-daylight to extremely dim light. Versions low-light settings of 1 lux and ultra-bright settings up to 100,000 lux are available.

Several lightboxes are available from the Imatest Store. There are compared in the Lightbox Comparison Guide. The GLE-10 and GLE-16E have well-controlled color temperatures. The Imatest LED Lightbox and Light Panels are extremely reliable and have a variety of options.

Imatest Dynamic range is defined in two ways (both displayed in Multicharts, Multitest, and Stepchart).

 Imatest Quality (SNR)-based Recommended in most cases. The range of exposure where the pixel level is below 98% of the saturation level (250 for 8-bit systems, which have a maximum of 255), and the scene-referenced Signal-to-Noise Ratio (SNRscene) is greater than a specified minimum amount (Imatest calculates DR for the four levels shown on the right). The higher the SNRscene (the lower the noise) in a region, the better the image quality. SNR tends to be worst in the darkest regions. SNRscene ≥ 10 = 20dB; high quality     SNRscene ≥  4  = 12dB medium-high quality     SNRscene ≥  2  = 6dB; medium quality     SNRscene ≥  1  = 0dB; low quality Slope-based (introduced in Imatest 4.4) (Not recommended) The range of exposure where slope of the density curve is greater than 7.5% of the maximum slope (on the dark side) and less than 98% of the saturation level (on the light side). This has to be done with care since noise and irregular density steps in the original data affect patch levels, and hence slope measurement. Test chart density is interpolated to have 101 evenly-spaced points, then the log pixel level for these points is found using the Matlab interp1 function. The curve is smoothed using a rectangular kernel 9 points wide (approximately 1/11 of the total range). This algorithm gives better results than earlier (pre-4.4) Patch range and detected DR measurements, but it should be interpreted with care because SNR can be extremely low (often well under 1 = 0 dB) in the the dark portion of the range. This can result in measurement inconsistencies as well as overly optimistic measurements, since no meaningful image is visible (it’s all noise) when SNR < 1. Slope-based DR can be falsely increased by tone-mapping and by medium-range flare light (bleeding from light chart patches, visible in the Image Statistics images below). For this reason WE DO NOT RECOMMEND IT. The Contrast Resolution chart and analysis provides a much better indication of true camera (system) DR.

### How to measure Dynamic Range

 Unit Scaling Notes Used by f-stops log2; Factor of two also called zones or EV (Exposure Value); Photographers decibels (dB) 20 log10 1 density unit = 20dB; one f-stop = 6.02dB electrical engineers density units log10; Factor of ten 1 density unit = 3.322 f-stops optical scientists
 Place the chart on the lightbox— or any source of uniform diffuse light. Be sure to block direct light from the lightbox outside of the chart: Stray light can reduce the measured dynamic range; it should be avoided. The lightbox and chart are shown inside a black box that minimizes stray light reflecting back to the chart. Pay no attention to that man behind the curtain. Frame the chart so it occupies the central portion of the image (unless the camera has extremely low resolution). This avoids problems that can arise from lens vignetting (light falloff). The image of the chart does not need to be more than 1000 to 1500 pixels high. An example of good framing for a 36-patch Dynamic Range chart acquired on a high resolution camera is shown on the right.
• Here is an example of an image with a framing problem. Flare light from the lightbox surrounding the chart will decrease the measured dynamic range. Avoid this unless you want to measure the effects of flare light.
The image on the right has another problem, shown in the crop on the left. Strange signal processing (sharpening) makes the registration marks difficult to detect, so you may need to manually select the chart region (instead of using the much more convenient auto detection).
• Photograph the chart in a totally darkened room. No stray light should reach the front of the target; it will distort the results. The surroundings of the chart and camera should be kept as dark as possible to minimize flare light.
• Use your camera’s histogram to determine the minimum exposure that saturates the lightest region of the chart. Slight overexposure is OK, but strong overexposure or underexposure may reduce the number of useful zones— resulting in a decreased dynamic range measurement. The lightest region should have a relative pixel level of at least 0.98 (pixel level ≥ 250 for 8-bit systems); otherwise the full dynamic range of the camera will not be detected. If the lightest zone is below this level, and a transmission chart is selected, a Dynamic range warning is issued.
 Reflections can be a serious issue.  We recommend covering everything near the camera, except the lens, with black velvet or fleece. Reflections from the lens itself are hard to avoid, but their effects can be mitigated it by placing the camera so that its reflection is in the exact center of the image (for charts with circular layouts). This places the reflection outside of the density patches. In the image on the right, a reflection below the chart center spoils the measurement of a density patch. It’s easy to miss when taking the picture, but it can be painfully obvious when the image is viewed lightened (tone-mapped in this case). The camera needs to be raised slightly go get the reflection out of the density patches.
•

For flatbed scanners with transparency units (light sources for transparencies), you can simply lay the step chart down on the glass. Stray light shouldn’t be an issue, though there is no harm in keeping it to a minimum. 35mm film scanners may be difficult to test since most can only scan 35mm segments. (Most transmissive targets are longer.)

• Where possible, save the image in a 16-bit (or more) format. Note that JPEG images are always 8 bits (pixel levels 0-255). This can seriously compromise dynamic range measurements, especially for HDR cameras.
• Follow the instructions for running Color/Tone Setup (Multicharts), or Color/Tone Auto (Multitest), or  Stepchart (not recommended for new work) for analyzing the image.
• Be sure to select the correct chart type in the settings window. These programs support a variety of linear (single row) and nonlinear (multiple row; often in a circular arrangement) charts. 36-patch Dynamic Range charts require that you enter a reference file for accurate results.

 Tip: to facilitate Dynamic Range plots in Color/Tone Auto (Multitest) we’ve added a button to the settings window. Pressing it enters the correct settings for a DR display (checks the Noise/SNR plot, and selects 15. F-stop…SNR and Density response above noise). the X-axis & DR units are unaffected.

Here are  Color/Tone and Stepchart results for the Panasonic G3 (a Micro Four-Thirds camera with 3.75 micron pixel pitch) at ISO 160, converted from raw using dcraw with the following settings: Demosaicing: Normal RAW conversion (demosaiced), Output gamma: 2.2, White Balance: Camera, Output color space: 48-bit, Quality: Default.

Panasonic G3, ISO 160, Converted with dcraw, run with Multitest.

The grayed-out area on the left (of the upper and lower plots) is where the scene-reference SNR is less than 0 dB (S/N < 1). Images are useless at this SNR. The grayed-out area at the bottom of the lower plot is where SNR < 0 dB.

 Dynamic range legend Line color Quality level S/N SNR (dB) DR is the range of exposure where scene-referenced SNR ≥ the specified level. L (Low) 1 0 M (Medium) 2 6 M-H (Medium-High) 4 12 H (High) 10 20

The slope-based dynamic range is greater than 11 f-stops (66dB). This measurement is not meaningful because it includes patches with SNR below 0 dB, where noise overwhelms visible features, i.e., no image detail would be visible. The DR at low quality level (scene-referenced SNR = 1 = 0dB) is 8.7 f-stops (52.4 dB), decreasing to 5.17 f-stops at high quality level (SNR = 10 = 20dB). These results are similar for 24-bit raw conversion.

Same Panasonic G3 image, run with Stepchart.
Click on image for full-sized display.

The shape of the response curve is a strong function of the conversion software settings. The plot below is for the same exposure, saved as a JPEG file inside the camera. Note that the transfer curve is quite different: it has a “shoulder” in the highlights, which improves pictorial quality by reducing the tendency of highlights to saturate (“burn out”). Dynamic Range is increased due to software noise reduction (absent in the dcraw conversion).

Panasonic G3, ISO 160, in-camera JPEG, run with Color/Tone Auto (Multitest). Note the “shoulder.”
Dynamic range is improved due to software noise reduction.

In Stepchart, units for displaying Dynamic Range can be set in the X-axis scale (Figs 2-4) and Dynamic Range units (Fig. 2) dropdown menu. To convert dynamic range from f-stops into decibels (dB), the measurement normally given on sensor data sheets, multiply the dynamic range in f-stops by 6.02 (20 log10(2)). The dynamic range for low quality (f-stop noise = 1; SNR = 1) corresponds most closely to the number on the data sheets. (A valid sensor Dynamic Range measurement requires completely raw images.)

Panasonic G3, ISO 160, in-camera JPEG,
run with Stepchart. Click on image for full-sized display.

### The Contrast Resolution chart

The Contrast Resolution chart was developed to overcome critical limitations of standard DR measurements derived from grayscale charts. We are working on standardizing it, especially in the IEEE P2020 standard for automotive system image quality. A paper that describes the Contrast Resolution chart, presented at Electronic Imaging 2018, can be downloaded here.

The key to understanding the Contrast Resolution chart is that Dynamic Range can be defined more meaningfully when it predicts the visibility of low contrast features over a range of tones, i.e., answers the question, “Will a low contrast feature be visible in a dark (or light) area of the image?” Standard DR measurements don’t provide a clear, unambiguous answer to this question.

The Contrast resolution chart consists of 20 large patches that cover a 95 dB tonal range. Each large patch contains four smaller patches. The light and dark gray patches have a 2:1 (6 dB) contrast ratio (100% Weber contrast) and the same mean density as the surrounding large patch. The difference between them defines the signal for the newly-developed Contrast Resolution Signal-to-Noise Ratio (SNRCR) measurement, where the noise is measured in the larger gray patch, which has better noise statistics. This signal is not distorted by flare light, uncorrected black level offset, or tone mapping. The red and blue patches are for visual analysis only.

Before we say more, we have to answer the question,

“Why only 95 dB when sensors have up to 150 dB dynamic range, and there is getting to be quite an intense DR competition? (This competition is somewhat akin to the automotive horsepower race of the 1950s, which culminated when TV comedians adopted the line, “My car can pass anything on the road except a gas station.”)”

The answer is we have yet to see a real practical camera whose dynamic range (which is always limited by flare light) reaches 95 dB, much less surpasses it. (Also, it’s more expensive to manufacture practical charts of this type with a higher tonal range). Customers who expect higher dynamic ranges from sensors specified at up to 150 dB DR may not be pleased by the harsh reality of placing a lens between the sensor and the test chart or scene. Please contact us at support@imatest.com if your camera’s DR exceeds 95 dB.

Standard (—) and Contrast Resolution () signal (top) and SNR (bottom). Note dB = 20*density.

Here is a brief explanation of Contrast Resolution measurements. See the Contrast Resolution page for full details.

The example on the right, run on Multicharts, uses an image of the Contrast Resolution chart taken with the Canon EOS-6D and 100mm f/2.8 macro lens at f/4, converted to a 48-bit color file (bit depth = 16)— a very high quality DSLR camera and lens, but not specifically marketed as HDR (High Dynamic Range).

Log pixel levels for the large gray patches, which are used as the signals in standard DR analyses, are shown in the upper plot as thin black lines. The Contrast Resolution signal (light-dark levels) is shown as thick magenta lines.

The lower plot shows standard SNR (thin black line) and Contrast Resolution SNR (SNRCR), where the signal is the small light-dark patch level and the noise is measured in the larger adjacent gray area. The colored horizontal lines are Contrast Resolution Dynamic Ranges (DRCR) corresponding to SNRCR = 20, 12, 6, and 0 dB (S/N = 10, 4, 2, 1; optimistically designated as “High”, “Medium-High”, “Medium”, and “Low” quality). The small patches are clearly distinguishable (high quality) at SNR = 20 dB, but barely distinguishable (low quality) at 0 dB.

 The image on the right displays all patches at a constant mean pixel level, making it easy to visualize the effects of noise. The 2:1 (100% Weber) contrast features are clearly visible in patches 1-13, are fading badly in patches 14 and 15, and are pretty much gone beyond that. Patch 13 has about 8 dB (20*log10(2.42)) Contrast Resolution SNR. The definition of Contrast Resolution Dynamic Range DRCR is based on the range of tones where SNRCR is greater than the levels specified above (20, 12, 6, and 0 dB; S/N = 10, 4, 2, 1). Note that SNRCR = 1 (used to define DR in conventional measurements) corresponds to quite horrible image quality, where features are only marginally visible only if you know exactly what to look for. Click on the images to display them full-sizedImage with patches normalized to have the same mean pixel level.

A key advantage of the Contrast Resolution chart is that it provides good results in the presence of tone mapping— a type of nonuniform tonal compression that maintains local contrast. Tone mapping is widely used for HDR images intended for human viewing (on displays with limited dynamic range). Standard grayscale charts do not provide reliable results for tone mapped images. The Contrast Resolution chartis results are also not distorted by flare light and uncorrected black level offsets.

Once again, we have to state that although we believe that the Contrast Resolution chart provides a superior indication of system performance, it is not yet an industry standard. We are actively working on it. For more details, see the Contrast Resolution page.

### Tips and measurement recommendations

There are a number of things to consider when measuring dynamic range. Most importantly, dynamic range measurements are strongly affected by flare light from the scene (i.e., the chart), image processing (especially bit depth, black level offset, noise reduction, and tone mapping). The experimental setup is critical.

 Light from the environment reflecting back to the front of the test chart should be minimized. It can seriously degrade DR measurements, especially for HDR (DR > 100dB) systems. Be especially careful to avoid reflections from the lens (which should be in the middle of the chart, outside the measurement area). The test environment should be totally darkened. Where possible, walls should be dark. Black cloth should be used to cover lights and light surfaces might reflect light back to the chart. Stray light is the major cause of DR measurement error.

For Imatest Dynamic Range or Contrast Resolution charts (shown above) the chart size in the image should be at least 600×600 pixels if possible. For high resolution cameras it doesn’t need to fill the image. A 2000×2000 chart image is more than sufficient for high resolution cameras.

Flare light (stray light that reaches the image sensor after bouncing between lens elements and the lens barrel) is the most significant practical limiting factor for DR. It can take the form of fog in shadows (veiling glare) or ghost images (challenging to measure). Flare light can arise from light areas or light sources inside the chart or (in real-world situations) outside the chart. Because of this, the choice of test chart can have a significant effect on DR measurements. Measurement errors caused by flare light are described below.

When possible, DR should be measured in images converted from raw format (the sensor output) with minimal processing and if possible with bit depth of at least 16. This can be done in Imatest using dcraw or Readraw, which do not apply a tonal response curve, sharpening, or noise reduction, hence have relatively little effect on DR.

Dynamic Range can be measured by the Imatest Multicharts, Multitest, and Stepchart modules. Multicharts (which is highly interactive) and Multitest (a batch-capable module that includes virtually all Stepchart functions) are recommended because they are newer and have more noise analysis detail than Stepchart.

Image processing can be divided into two categories: processing routinely done during raw conversion and post-processing that is applied afterwards. Both can affect DR measurements.

Raw conversion converts the output of the sensor to a standard image format. It includes several functions (some optional). All the functions listed below are typically applied during in-camera raw conversion (typically with JPEG output). RAW conversion performed in Imatest (using dcraw or Readraw) do not apply a tonal response curve, sharpening, or noise reduction, hence have relatively little effect on DR.

• Demosaicing (converting Bayer RGRG/GBGB format to full color with RGB in each pixel) has relatively little effect on dynamic range.
• Gamma curve  Most interchangeable files are gamma-encoded, i.e., they are intended to be displayed with brightness proportional to pixel levelgamma (with gamma typically = 2.2). The simplest gamma encoding is pixel level = scene brightness(1/2.2). When the converted image has a bit depth of 8 (commonplace for non-HDR images), gamma encoding significantly improves dynamic range. 8-bit linear images have limited dynamic range because they have very few levels in dark areas.
• Tonal response curve (TRC).  Frequently applied in addition to gamma. A “shoulder” (contrast reduction) applied to the highlights is the most frequent feature of tonal response curves, but dark areas may also be affected. TRCs definitely affect DR measurements (especially slope-based DR), and can do so in complex ways.
• Sharpening  is often performed near edges, but may not be applied to flat areas where DR is measured.
• Noise reduction (lowpass filtering) is often performed in flat areas where DR is measured. Noise reduction can have a profound effect on DR measurements. In particular, SNR = 1, which is a criterion for the DR limit in some standards, may never be reached.
• Color correction matrix (CCM) and white balance (WB).  A CCM can increase noise, especially when colors are intensified. But most of the time CCMs have a minor effect on DR measurements.

Additional image processing may be applied following raw conversion.

• Bit depth  Most interchangeable images have a bit depth of 8, which can limit DR, especially with linear images. Bit depth = 8 does less harm to gamma-encoded images. Bit depths = 16 or greater has much less effect.

• JPEG  High quality JPEG compression has little effect on DR. Low quality JPEG compression messes up DR (and all other image quality measurements), and should never be used for DR measurements. The real issue with JPEGs is that in-camera processing (described above) can seriously affect DR and the bit depth of 8 limits DR.

• Tone mapping is performed when HDR images need to be viewed on devices with limited dynamic range (which means pretty much all of them in practice). Tone mapping compresses tones in relatively large areas (such as grayscale test chart patches) while maintaining tonal contrast in small areas (local contrast). It is discussed in the page on the Contrast Resolution chart.

Tone mapping reduces contrast measured on standard grayscale charts, which give no indication of how well local contrast is preserved. (The Contrast Resolution chart and analysis were designed to measure local contrast.) Tone mapping can be studied with the Image Processing module, which lets you open any image, add noise noise and other degradations, then apply image enhancements, including three types of tone mapping supported by Matlab (tone mapping, local tone mapping, and Contrast-Limited Adaptive Histogram Equalization). We have found that tone mapping tends to be sensitive to small changes in the noise level. (Of course cameras may use completely different algorithms.)

Tone mapping is fairly easy to identify. Measured gamma is much lower than values typical for standard color space images (around 0.5), and patch levels may not decrease monotonically. The Image Statistics example below shows evidence of tone mapping. The effects of tone mapping on DR measurements are not easy to predict: it should be regarded as a complete wildcard. Dynamic Range measurements of tone-mapped images are not reliable.

The slope-based Dynamic Range (which is sometimes considered total DR because it tends to be larger than SNR-based DR measurements) is defined as the range of exposure where slope of the density curve is greater than 7.5% of the maximum slope (on the dark side) and less than 98% of the saturation level (on the light side). Since tone mapping reduces the maximum slope, it increases the slope-based DR. The slope-based DR often has an extremely low SNR in the dark part of its range, −10 dB or worse, which makes it quite inconsistent, even without tone mapping.

• Pixel level (black level) offsets, which are often applied to images, have a significant effect on DR measurements. They should be removed if they are present. The default Offset setting is 0. To subtract the offset in Multicharts, click the Settings button (if it’s visible) or the Settings dropdown menu, then Color matrix and other settings… The Offset setting is in the lower left of the Settings window. The setting appears in yellow if it’s different from the default value of 0. Offsets can also be corrected during raw conversion with Generalized Read Raw.

Image Statistics cross-section display showing lightened XYLA chart. A black level offset of 8 bits is likely.

The Image Statistics module can be used to examine the image for tone mapping, flare light, pixel level offsets, and other surprises. It provides information that can be useful when testing DR. The example shows a XYLA chart (a linear chart with density steps = 0.3), which is designed to minimize flare light (the lighter patches are relatively small). The image below is displayed lightened (this does not affect the numeric results below the image). The lower plot is a 35 pixel-wide cross-section of from the chart (averaged to reduce noise). There appears to be a pixel offset of 8 in the black areas outside the chart patches, though it could be long-range flare light (that affects the image uniformly). Some short-range flare light is visible in about 60 pixels to the left of the brightest patch. It’s actually quite well controlled; we’ve seen worse.

The flattening of the response in patches 4-6 indicates that tone mapping has been applied. If it were not caused by tone mapping, this would mean that there would be no image contrast at these densities— an unacceptable result. This is a case where the Contrast Resolution chart provides information that is simply not available from a straight grayscale chart.

### More on flare light

Flare light can be extremely complex. It can add a uniform offset to the image (often called “veiling glare”), which is difficult to distinguish from a black level offset. It is often largest near bright patches, then decreases with distance from these patches. The rate of decrease is rarely a well-behaved exponential.

This decrease can cause measurement errors because it can falsely resemble changes in chart density.

The Image Statistics horizontal cross-section on the right shows the effects of significant flare light on an image of the XYLA chart. Very strong flare light is visible to the left of the chart, and the pixel level continues to drop in areas on the right where chart patches are no longer visible (even when the image is extremely lightened).

The lower image— a horizontal cross section of the same image taken below the the chart (displayed with extreme HSL lightening)— shows that this decrease is caused by flare light— not from the camera’s response to the chart.

X-cross-section taken at the center of the XYLA chart

X-cross section taken below the XYLA chart,
showing significant effects of flare light.

Note that the decrease in pixel level on the right of the chart (around x ≥ 1500) erroneously increases the measured Dynamic Range from slope. The best way to distinguish a pixel level decrease due to flare light from a decrease due to patch densities is with a different chart design, such as the Contrast Resolution chart.

 Lens reflections are a major cause of medium-range flare light. An uncoated glass surface (index of refraction ≅ 1.5) reflects R = 4% = 0.04 of the light incident on it. (Remember, a sheet of glass or a lens component has two surfaces.)  For each glass surface between this surface and the light source, a fraction R of the primary reflection (R2 of the original incident light) is reflected back to the image sensor. This are called a secondary reflection. Since most lens surfaces are curved, this light will be unfocused, i.e., it will tend to fog a portion of the image.  According to Edmund Optics, the best anti-reflective coatings have R ≅ 0.4% = 0.004 over the visible spectrum (~400-700nm). R = 0.005 may be more realistic for a reasonable range of incident angles. The light reflected back to the sensor from each secondary reflection would be R2 = 0.000025 = 2.5*10-5 = -92 dB (20*log10(R2)). The number of secondary reflections Nsec increases rapidly with the number of components M (groups of elements cemented together, each of which has two air-to-glass surfaces) in a lens: 1 for 1 component; 6 for 2 components; 15 for 3 components; 28 for 4 components; 45 for 5 components, etc. For M components,      $$\displaystyle \text{Number of secondary reflections} = N_{sec} = \sum_{i=1}^{2M-1}i = 2M(2M-1)/2 = M(2M-1))$$ M = 5 components are typical for high quality camera phones; M ≥12 components is commonplace for DSLR zoom lenses. Overall lens flare is less severe than the number of secondary reflections suggests because the stray light don’t cover the whole image. It decreases with distance from bright regions. It’s easy to see why practical camera Dynamic Range measurements are limited to around 70-90dB, even when sensor Dynamic Range is much higher. Image Statistics cross-section of a Contrast Resolution image for an automotive camera, showing spatially-varying flare Because the ISO 18844 flare model does not measure the spatially-dependent flare caused by lens reflections, it’s value in characterizing practical system performance is limited.

#### Effects of noise

Noise is a random stochastic process. When noise is high in relation to signal level (low SNR), is can have a strong effect on measurement consistency. In particular, the slope-based dynamic range has been discussed in several places above. A key problem with this measurement is that SNR is frequently very low (−10 dB or worse) at its darker limit. (It can also be affected by tone mapping and flare light.) For this reason we don’t recommend its use.

Region selection in linear charts such as the XYLA charts (which have 21 or more f-stops of dynamic range) can be extremely difficult because (a) It is difficult to see dark patches in the denser parts of the causes, (b) it is affected by optical distortion, which can be corrected with difficulty, and (c) it can be affected by keystone distortion (which can also be corrected, but with considerable difficulty). Unfortunately small errors in region selection can significantly affect measurements. This issue was the primary reason we designed the 36-patch Dynamic Range charts (as well as the Contrast resolution chart), both of which have patches arranged in a circular pattern with registration marks for automatic region selection (or easy manual selection if automatic doesn’t work).

### Flare light-limited Dynamic Range (Imatest 5.2+)

The following is an example of a flare light-limited image run in Imatest 5.2. In circular charts (unlike linear charts) flare light drops off in a direction (top to bottom) perpendicular to the patch sequence (left to right) in darker regions. This makes it relatively easy to recognize when the image is being limited by flare light because the density response curve slope drops to zero. This is evident in the upper (density) plot in the image below, where the slope flattens out between 75-100 dB, 105-140 dB, then beyond 145 dB — corresponding to the 6th through 8th rows of patches at the bottom of the chart.

Flare light-limited Dynamic Range result for 36 patch UHDR chart

In this image the scene-reference SNR (dB) stays above 0 to beyond Exposure = -120 dB, but the slope (upper plot) starts to flatten out around -85 dB.Since the pixel level drops to 98% of its maximum level around -15 dB, Dynamic Range is limited to about 70 dB. It would be 120 dB or more without the slope limitation.

### Technical details

#### F-stop noise and scene-referenced SNR

The human eye responds to relative luminance differences. That’s why we think of exposure in terms of zonesf-stops, or EV (exposure value), where a change of one unit corresponds to a factor of 2 change in exposure.The eye’s relative sensitivity is expressed by the Weber-Fechner law,

Δ≈ 0.01 L  –or–  ΔL/L ≈ 0.01

where ΔL is the smallest luminance difference the eye can distinguish. This equation is approximate; effective ΔL tends to be larger in dark areas of scenes and prints due to visual interference (flare light) from bright areas.

Expressing noise in relative luminance units, such as f-stops, corresponds more closely to the eye’s response than standard pixel or voltage units. Noise in f-stops = Nf-stop is obtained by dividing the noise in pixels by the number of pixels per f-stop. (We use “f-stop” rather than “zone” or “EV” out of habit; any of them are OK.) Note that 1 f-stop = 0.301 Optical density units = 6.02dB (decibels) = log2(luminance).

Also note that Nf-stop is scene-referenced noise in (logarithmic) units of f-stops, and must be distinguished from linear scene-referenced noise, Nscene-ref, which has the same linear units as luminance (the scene signal).

 $$\text{F-stop noise } = N_{f-stop} = \displaystyle \frac{N_{pixels}}{d(\text{pixel})/d(\text{f-stop})} = \frac{N_{pixels}}{d(\text{pixel})/d(log_2 \text{luminance})}$$           $$= \displaystyle \frac{N_{pixels} \times ln(2) \times \text{luminance}}{d(\text{pixel})/d(\text{luminance})} ≅ \frac{N_{pixels} \times \text{luminance}}{d(\text{pixel})/d(\text{luminance})}$$ where Npixels is the measured noise in pixels and $$d(\text{pixel})/d(\text{f-stop})$$ is the derivative of the signal (pixel level) with respect to scene luminance (exposure) measured in f-stops = log2(luminance). We used $$d(log_a(x)) = dx / (x \, ln(a))$$. ln(2) = 0.6931 has been dropped to maintain backwards compatibility with older Imatest calculations. Noting that luminance (exposure) is the signal level of the scene,      $$\displaystyle \text{Scene-referenced noise} = N_{scene-ref} = \frac{N_{pixels}}{d(\text{pixel})/d(\text{luminance})} ≅ \frac{N_{f-stop}}{\text{luminance}}$$       $$\displaystyle \text{Scene-referenced Signal-to-Noise Ratio} = SNR_{scene-ref} = \frac{\text{luminance}}{N_{scene-ref}} = \frac{1}{N_{f-stop}}$$ Displays in Stepchart, Multicharts, and Multitest offer a choice between f-stop noise or Scene-referenced SNR (expressed as a ratio or in dB). Note that SNRscene-ref decreases as the slope of the tonal response curve decreases (often the result of flare light in dark patches).

The above-right image illustrates how the pixel spacing between f-stops (and hence d(pixel)/d(f-stop)) decreases with decreasing brightness. This causes f-stop noise to increase with decreasing brightness, visible in the figures above.

Since f-stop noise and scene-referenced SNR are functions of scene luminance, largely independent of image signal processing and fogging from flare light, they are an excellent indicators of real-world camera performance. They are the basis of Imatest Dynamic Range measurements.

#### How is incident light measured?

Incident light has to be measured to obtain the camera’s Exposure Index (ISO Speed).

Reflective charts: Incident light measurement is relatively straightforward. Place an incident illumination meter with a flat diffuser (such as the inexpensive BK615) just in front of the chart, pointed towards the camera, making sure not to block any of the illumination. Use the lux measurement directly.

Transmissive charts: These are not so straightforward: the lux measurement cannot be used directly. You will need to measure a clear (white) area of the chart (not the lightbox itself). For meters like the BK 625, where you can switch the orientation of the sensor, set it to point towards the light source (on the opposite side from the display). Measure the illumination in a white area of the chart. For the 36-patch Dynamic Range chart, use the lightest grayscale patch. You need to make an adjustment because the input to Imatest is designed for reflective charts, where white areas reflect about 90% of the incident light. To compensate for this, use

Lux (input to Imatest) = Lux (measured) * 1.11.

Useful equation: If your meter reads in EV (Exposure Value): Lux = 2.5 * 2EV @ ISO 100
Note: EV @ ISO 100 is also known as Light Value (LV).

### Image Quality Factors for Cameras and Displays

Summary table — corresponding test charts and modules