Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Introduction

...

Eazy math inline
body\text{pixel level = (RAW pixel level)}^ \ \ \ \ \ \gamma \approx \text{exposure} ^ \gamma

There are actually two gammas:

  1. encoding gamma, which relates scene luminance to image file pixel levels, and

  2. display gamma, which relates image file pixel levels to display luminance. It is typically found in equations of the form,

...

The chart and images are several years old. The chart may have been printed with lower contrast than intended, resulting in a lower gamma measurement. This has no effect on the relative measurements below

Gamma

MTF50 (C/P)

MTF Area PkNorm (C/P)

0.20

0.2415

0.261

0.30

0.2408

0.258

0.322

0.2368

0.254

0.40

0.2387

0.254

0.50

0.2344

0.247

0.60

0.2332

0.247

Note that errors in estimating gamma (differences from 0.322) have very little effect on MTF measurements. MTF50 and MTF Area change very slightly, even with relatively large gamma errors. This is a good place discuss Imatest’s ISO 12233 compliance. Imatest uses a simple first-order inverse of the OECF curve (tonal response) measurement to linearize the image. It does not use a higher-order inverse. But because MTF is relatively insensitive to gamma (the slope of the tonal response curve), the simple fit results in nearly identical MTF measurements (except the the exposure is close to saturation, which where it’s hard to avoid dodgy results). 

...

The chart on the right is designed for a visual measurement of display gamma. But it  rarely displays correctly in web browsers (and may never display correctly on this Atlassian page, where there is no way to set it to 100% size). It has to be displayed in the monitor’s native resolution, 1 monitor pixel to 1 image pixel. Unfortunately, operating system scaling settings and browser magnifications can make it difficult.

...

For completeness, we’ve updated and kept this table from elsewhere on the (challenging to navigate) Imatest website.

Parameter

Definition

Tonal response curve

The pixel response of a camera as a function of exposure. Usually expressed graphically as log pixel level vs. log exposure.

Gamma

Gamma is the average slope of log pixel levels as a function of log exposure for light through dark gray tones). For MTF calculations It is used to linearize the input data, i.e., to remove the gamma encoding applied by image processing so that MTF can be correctly calculated (using a Fourier transformation for slanted-edges, which requires a linear signal).

Gamma defaults to 0.5 = 1/2, which is typical of digital camera color spaces, but may be affected by image processing (including camera or RAW converter settings) and by flare light. Small errors in gamma have little effect on MTF measurements for 4:1 (low) contrast ratio edges (See How strongly does gamma affect MTF? above). Gamma should be set to 0.45 or 0.5 when dcraw or LibRaw is used to convert RAW images into sRGB or a gamma=2.2 (Adobe RGB) color space. It is typically around 1 for converted raw images that haven’t had a gamma curve applied. If gamma  is set to less than 0.3 or greater than 0.8, the background will be changed to pink to indicate an unusual (possibly erroneous) selection.

If the chart contrast is known and is ≤10:1 (medium or low contrast), you can enter the contrast in the Chart contrast (for gamma calc.) box, then check the Use for MTF (√) checkbox. Gamma will be calculated from the chart and displayed in the Edge/MTF plot.

If chart contrast is not known you should measure gamma from a grayscale stepchart image. A grayscale is included in SFRplus, eSFR ISO and SFRreg Center ([ct]) charts. Gamma is calculated and displayed in the Tonal Response, Gamma/White Bal plot for these modules. Gamma can also be calculated from any grayscale stepchart by running Color/Tone Interactive, Color/Tone Auto, Colorcheck, or Stepchart. [A nominal value of gamma should be entered, even if the value of gamma derived from the chart (described above) is used to calculate MTF.]

Gamma is the exponent of the equation that relates image file pixel level to luminance. For a monitor or print,

Eazy math inline
body\displaystyle \text{Output luminance = (pixel level)}^{gamma\_display}

When the raw output of the image sensor, which is typically linear, is converted to image file pixels for a standard color space, the approximate inverse of the above operation is applied.

Eazy math inline
body\displaystyle \text{Pixel level = (RAW pixel level)}^{gamma\_encoding} \approx exposure\ ^{gamma\_encoding}

This is equation is an approximation because the tonal response curve (which often has a “shoulder”— a region of decreased contrast in the highlights) doesn’t follow the gamma equation exactly. It is often a good approximation for light to dark gray tones: good enough for to reliably linearize the chart image if the edge contrast isn’t too high (4:1 is recommended in the ISO 12233:2014+ standard).

Eazy math inline
body\text{Total system contrast} = gamma\_encoding \times gamma\_display
The most common value of of display gamma is 2.2 for color spaces used in Windows and the internet, such as sRGB (the default) and Adobe RGB (1998).

In practice, gamma is equivalent to contrast

When the Use for MTF checkbox (to the right of the Chart contrast dropdown menu) is checked, camera gamma is estimated from the ratio of the light and dark pixel levels P1 and P2 in the slanted-edge region (away from the edge) if the chart contrast ratio (light/dark reflectivity) has been entered (and is 10:1 or less). Starting with

Eazy math inline
bodyP_1/P_2 = \text{(chart contrast ratio)}^{gamma\_encoding}
,

Eazy math inline
body\displaystyle gamma\_encoding = \frac{\log(P_1/P_2)}{\log(\text{chart contrast ratio)}}

Shoulder

A region of the tonal response near the highlights where the slope may roll off (be reduced) in order to avoid saturating (“bunring out”) highlights. Frequently found in pictorial images. Less common in machine vision images (medical, etc.) When a strong shoulder is present, the meaning of gamma is not clear.

Toe

Counterpart of the shoulder (area of reduced slope) in dark regions. Was common with film, but rare in digital images.

...

  1. Input gamma value(legacy, default) – The inverse of the value entered into the “Gamma (input)” field is used to linearize the data.

    1. Note: The input gamma value represents the “forward” (encoding) gamma value (typically around 0.46 = 1/2.2 for sRGB or Adobe RGB color spaces); the inverse (display gamma) is used for linearization.

  2. Gamma calculated from chart contrast (legacy) – The value selected for the “Chart contrast” setting is used, in combination with the contrast measured from the edge ROI region, to calculate a value for gamma on a per edge ROI basis. The inverse of this gamma is used to linearize the data.

    1. The gamma value is estimated from the ratio of the light and dark pixel levels P1 and P2 in the slanted-edge region (away from the edge) if the chart contrast ratio (light/dark reflectivity) has been entered (and is 10:1 or less). Starting with

      Eazy math inline
      bodyP_1/P_2 = \text{(chart contrast ratio)}^{gamma\_encoding}
      ,
      Eazy math inline
      body\displaystyle gamma\_encoding = \frac{\log(P_1/P_2)}{\log(\text{chart contrast ratio)}}

    2. Note: The calculated gamma value(s) are included in the JSON output as the field “gamma_from_chart”, on a per edge ROI basis (this is not a new output)

  3. No linearization (new) – The data is not linearized.

    1. Note: “Input gamma value” of 1 is equivalent to “No linearization”.

  4. Linearly interpolated LUT from step chart (new, requires step chart analysis to be checked) – A linearly interpolated look-up-table (LUT), representing the inverse of the measured OECF, is calculated from the mean of the grayscale patch (step chart) ROIs and the nominal patch densities (or those from a grayscale reference file). The LUT is used to linearize the data.

    1. Note: A grayscale reference file contains measured patch densities and can be loaded from the Rescharts more settings window

  5. Gamma calculated from step chart (new, requires step chart analysis to be checked) – The mean of the grayscale patch (step chart) ROIs and the nominal patch densities (or those from a grayscale reference file) are used to calculate a value for gamma. The calculated gamma is the slope of a linear fit of the patch densities and log(grayscale patch means). The inverse of this gamma is used to linearize the data.

    1. Note: A grayscale reference file contains measured patch densities and can be loaded from the Rescharts more settings window

    2. Note: The calculated gamma value is the same as that which appears on the Rescharts Tonal Response plot, also corresponding to the gray dotted line on the plot (the gamma value is the slope of this line). Note that there is also a gray dashed line that represents a 2nd order polynomial fit.

    3. Note: The calculated gamma value is included in the JSON output as the field “gamma_from_stepchart” (this is not a new output)

    4. Note: The range of patches is limited for the calculation of gamma, specifically using the patches that have a mean within the central 80% of the total range of patch means. Therefore, some darker or lighter patches may not be used for calculation of this gamma.

...

(warning) Note: The new dropdown replaces the “Use for MTF” checkbox on all relevant GUIs, which now corresponds with the “Gamma calculated from chart contrast” option in the dropdown.

...

INI settings

A new INI field has been added for control of the new “Linearization method” setting on a per INI section (module/analysis) basis:

...

The user-selected linearization method is now included as a new field in the CSV and JSON outputs, as a way of documenting the input method. The new CSV field is “Linearization method”. The new JSON field is “linearization_method”.

...