Evaluation of Colorimetric Accuracy in Photoshop

0
1120

The workflows associated with the evaluation of colorimetric accuracy, or fidelity in color reproduction when working on Cultural Heritage digitization projects, scientific photography, or projects with a high demand for fidelity to the real scene, are largely unknown to most professionals, and unfortunately are largely absent from most manuals or digital photography courses we usually encounter.

The repeated omission to disseminate certain image quality control processes, in this case colorimetric accuracy, has always struck me as curious, since although they are abundantly cited in any digital image quality control standards and even in manuals from software and device manufacturers, it tends to be a topic timidly addressed by certain gurus and educators. I jokingly attribute this situation to a strategy to avoid topics that might invalidate the very advice proposed by these individuals.

Indeed, the strategies for evaluating the quality of the processes that lead to the formation of a digital image have the mission of validating or invalidating them as appropriate workflows to achieve particular objectives.

In our work environments, there should be no workflow oriented to color management or RAW development that has not been previously evaluated in order to estimate its degree of accuracy both colorimetrically and tonally. In fact, a good part of the tools oriented to color management, whether ICC profile design or monitor calibration/profiling or printer profiling, incorporate strategies to evaluate the accuracy of these processes.

In this article, I will not delve into workflows for process evaluation, but rather I will present and explain the fundamentals of a new Photoshop script I have released, designed to perform colorimetric and tonal accuracy assessments on Colorchecker color charts. This script has the simple objectives of estimating color differences between measured colorimetric values against reference ones. In this way, it is possible to know the distance, or difference, between two colors in terms of delta-e in order to have a perception of the error committed during the processes of designing ICC color profiles or Camera Profiles (DCP).

In addition to the delta-e evaluation, I have also added a tonal assessment to reflect aspects of tonal reproduction based on the densitometric scale of the Colorchecker itself, thus allowing us to evaluate whether our tonal adjustment during RAW development has been correct or not.

This script will generate a plain text (ASCII) report where the first part will present the colorimetric assessments and the second part the tonal reproduction:

Colorimetric evaluation:

For the first test shown, the following data are provided in the following columns:

  • Sample: This is the reference to the Colorchecker patch.
  • L, a, b (Results): These are the colorimetric values of our image, described in the CIELab space.
  • L, a, b (References): These are the colorimetric values of our color chart measured with a spectrophotometer. The values used are those generically provided by the ArgyllCMS tool, and for better accuracy it would be advisable to configure the script with those of our own chart.
  • dC: This is the chromatic difference between both samples expressed by the equation:
        C = (a2 + b2)1/2
        dC = CRes - CRef

    Where a and b correspond to the chromaticity attributes for CIELab.

  • dH: This shows the hue difference between both samples. The hue difference is expressed in Cartesian form and not the usual polar form, since the latter often leads to certain confusions for specific hue differences. This difference is expressed by the equations:
    dH = ( (CIE76)2 - (dL)2 - (dC)2) 1/2
  • CIE76: Expresses the color difference by the equation of the same name, under the well-known Euclidean distance formula between two colors:
    CIE76 = (  (LRef - LRes)2 + (aRef - aRes)2 + (bRef - bRes)2    )1/2
  • CIE00: Expresses the color difference by the equation of the same name. It performs a weighting of the main color attributes Luminosity, Hue, and Chroma, similarly to the human perception system. Its formula is relatively complex but can be consulted on Wikipedia.
  • Average: Indicates the average values for the columns dC, dH, CIE76, and CIE00

Tonal reproduction evaluation

Another aspect I have been advocating throughout past articles, closely related to the accuracy of an image towards the scene, is tonal reproduction.

Tonal reproduction evaluations are made through assessments around the optoelectronic conversion function (OECF), which expresses the relationship between the RGB values generated from certain illumination levels.

There are numerous strategies for these calculations; however, for the case at hand, the equations are simple. The interpretation of the data shown in the report is as follows:

  • Sample: As in the previous case, the identifier of the Colorchecker patch, but in this case only the gray or neutral patches, which are used for this type of test.
  • Res: These are the luminance values measured in our digital image. These values are generated from the RGB values of each sample by the equations:
    Y  =  (0.2126*R) + (0.7152*G) + (0.0722*B)

    The standard luminance, or observer luminance, needs to be gamma corrected:

    Y’ = (Y / 255 )g

    Where g is the gamma, usually 2.2. The RGB values used in the equations are not extracted directly from the image, since although I could obtain them, I would need two readings: one with the image in RGB mode and another with the image in LAB mode. Therefore, these values are obtained by converting CIELAB -> XYZ using a D65 illuminant, and then from XYZ -> RGB. I perform this transformation both for the values provided by the colorimetric data of our Colorchecker and the colorimetric data of our image.

  • Ref: This is the luminance of the colorimetry of our chart, obtained from its CIELAB values by the equations (Y and Y’) already shown.
  • Diff: This is the difference between the luminance values of our image and the reference ones:
    dY’ = Y’Ref - Y’Res
  • Average: This is the average error committed between sample and reference.

OECF Digital imageThe ideal way to understand the tonal reproduction evaluation is to graph both the Ref and Res values in order to denote particular deviations in highlights, midtones, or shadows.

Installation:

To have this script or tool in our Photoshop, we first need to download it: Color Analysis

Then install the .jsx in the corresponding directory which may vary depending on the operating system or PS version; some typical paths are:

/Applications/Adobe Photoshop CS4/Presets/

On Windows it is usually found at:

C:\Archivos de programa\Adobe\Photoshop CS4\Presets

After saving it in the Presets directory, we must restart PS if it was open.

Usage

colorSampler_1The use of this script is very simple:

  • We load an image of our Colorchecker in PS, either from a development with ACR or from a TIFF.
  • With the Pen tool (p) we trace a perimeter that must correspond to the four corner marks of our chart, starting from the upper left corner, then the lower left, the lower right, the upper right, and close at the upper left, as shown in the image.
  • Then, through the path File > Scripts > Color Analysis, we activate the script which will go through all the patches of our Colorchecker, leaving a series of black circles for each measurement, in order to leave a witness of where it was performed and what area it occupied.
  • Finally, in the same directory as the evaluated image, a file will be created under the name of our image preceded by the term “_color_analysis.txt”

From this report, it is already possible to have the aforementioned data for interpretation or quality reporting of a certain digitization process, color management, or simply RAW development.

Other tools:

For some time now I have maintained the development of a small delta calculator for Mac OS X operating systems, which allows us to evaluate isolated color samples by the CIE76 and CIE00 formulas, as well as dC, dH, dh, dL, da, and db.

Through this website, an online small calculator is also available that allows performing the same calculations, aimed at helping the reader become familiar with the concepts.

Previously, in the downloads section, I had various scripts similar to the one mentioned in this article. I have now removed them because they corresponded to old and less evolved versions of this same script.