When working with color charts, one of the most immediate concerns that arises when opening an image in our development tool is to verify the exposure level or white balance in order to continue with the design process of our profile.
Although it is not strictly necessary to make significant adjustments to the exposure or white balance of our test image intended for the creation of ICC color profiles, since the transformation routines of an ICC profile itself will correct these deviations, the fewer these corrections are, the more precisely we can work. Therefore, if our test image has exposure or white balance deviations, it would be advisable to review these values to some extent. However, it is important to consider the reasons for these deviations and apply the corrections made to our test image to the rest of the shots taken under these specific settings to maintain consistency in our workflow.
To make these adjustments, various authors and manufacturers have proposed RGB values that we can use as AIM Points, or reference points when managing the controls of our RAW developer.
However, how can we calculate what RGB values a particular patch of our color chart should have?
For this, we will need to perform a calculation or transformation of colorimetric values through the transformation tables of a given color profile. For this, we need to use tools such as ICCLU from ArgyllCMS. For example, when working with Adobe Camera RAW, the RGB values given by the samples correspond to the sRGB profile.
To know these RGB values, we first need to know the colorimetric values of the color patches of our chart. When we use a reference file of a color chart or use a spectrophotometer to obtain these colorimetric values, we can always obtain these values in the XYZ or CIE LAB space. These CIELAB values are the target values we should achieve with the correct design of our color profile, and although it might be feasible to convert from CIELAB to RGB, it is best to use the XYZ values provided by our reference file or spectrophotometer.
The ICCLU parameters could be as follows:
icclu -fb -py -s 255 -ip sRGB_Color_Space_Profile.icc
Where -fb indicates the type of conversion function, in this case, it will be a backward conversion, that is, from XYZ to RGB; if we used -ff, it would be a forward conversion, which is the usual process that occurs when assigning an ICC color profile to an image.
The option -py indicates that we will input the values in Yxy format, which will be a more suitable strategy for our purpose and will even serve as a reference for comparison with the RGB values data of, for example, our Colorchecker proposed by Danny Pascale.
The parameter -ip indicates that we will use the perceptual intent.
And finally, -s 255 scales our RGB values to the 0-255 format, which is the most common in our systems.
To convert our XYZ values into the Yxy space, we will use the well-known equations:
x = X / (X+Y+Z) y = Y / (X+Y+Z) Y = Y
So, for example, the XYZ values of patch A1 of our Colorchecker yield the following results:
12.12 10.67 5.31
x = 12.12 / 28.17 = 0.43 y = 10.67 / 28.17 = 0.37 Y = 10.67 / 100 = 0.1
Therefore, we would enter the following Yxy sequence in our terminal:
0.1 0.43 0.37
With the following output:
0.100000 0.430000 0.370000 [Yxy] -> MatrixBwd -> 107.150683 80.716453 72.122037 [RGB]
We can practice, for example, with the coordinates of the theoretical white point D50 so that:
1 0.3457 0.3585 (Yxy)
Will produce an obviously white result:
1.000000 0.345700 0.358500 [Yxy] -> MatrixBwd -> 255.013231 254.990241 255.031472 [RGB]
For example, if we use the SPOTREAD tool from ArgyllCMS on a Menon grayscale chart, we can introduce the parameter -x to get an output in Yxy format, so that:
spotread -x
Will produce:
Result is XYZ: 17.308179 18.214761 15.635522, Yxy: 18.214761 0.338325 0.356046
Then we would enter in ICCLU
0.18 0.338325 0.356046
Attention must be paid to converting Y to the 0-1 format by dividing it by 100
In this way, our Menon grayscale chart would have the following RGB values
0.180000 0.338325 0.356046 [Yxy] -> MatrixBwd -> 114.269131 118.462340 120.126209 [RGB]
As we see, it is very close to a theoretical neutral gray; however, we observe a certain inconsistency among the three channels. Theoretically, we should obtain the same value for all three, but that is a theoretical principle. In practice, most color charts do not have this balance, which is caused by small oscillations in their spectral distribution (SPD), which I have already reviewed in another article.
Therefore, if we wanted to review our exposure or white balance on this grayscale chart, we should obtain RGB values close to 114 118 120 and not the 127 127 127 that we might expect from a theoretical middle gray.
With this technique, we can, for example, calculate the RGB values of our Colorchecker, which is very interesting in case it has already aged somewhat and does not match the average values offered by third-party authors. To avoid the tedious task of entering all values one by one in ICCLU, I can use the trick:
icclu -fb -py -s 255 -ip sRGB_Color_Space_Profile.icm < entrada.txt > salida.txt
So that in the file entrada.txt we enter our Yxy values, generating a file salida.txt with the terminal output for each row of the entrada.txt file, thus obtaining the following table:
| X | Y | Z | Y | x | y | R | G | B | |
| A01 | 12,34 | 10,88 | 5,47 | 0,12 | 0,43 | 0,38 | 126,09 | 89,68 | 74,28 |
| A02 | 39,81 | 35,30 | 19,55 | 0,40 | 0,42 | 0,37 | 211,49 | 155,66 | 137,20 |
| A03 | 16,91 | 18,28 | 26,18 | 0,17 | 0,28 | 0,30 | 88,04 | 117,36 | 151,73 |
| A04 | 11,54 | 14,11 | 5,57 | 0,12 | 0,37 | 0,45 | 83,22 | 101,05 | 59,49 |
| A05 | 24,30 | 23,09 | 33,01 | 0,24 | 0,30 | 0,29 | 133,86 | 131,01 | 179,01 |
| A06 | 30,87 | 42,34 | 35,46 | 0,31 | 0,28 | 0,39 | 79,54 | 165,73 | 150,87 |
| B01 | 41,43 | 32,04 | 5,00 | 0,41 | 0,53 | 0,41 | 252,44 | 142,30 | 52,13 |
| B02 | 12,42 | 11,25 | 29,84 | 0,12 | 0,23 | 0,21 | 73,22 | 95,17 | 177,81 |
| B03 | 30,06 | 19,61 | 10,02 | 0,30 | 0,50 | 0,33 | 241,31 | 101,04 | 117,66 |
| B04 | 8,41 | 6,44 | 10,58 | 0,08 | 0,33 | 0,25 | 104,73 | 68,25 | 118,52 |
| B05 | 35,83 | 45,31 | 9,25 | 0,36 | 0,40 | 0,50 | 142,48 | 171,85 | 57,13 |
| B06 | 49,53 | 44,85 | 5,97 | 0,50 | 0,49 | 0,45 | 241,11 | 172,65 | 37,14 |
| C01 | 7,28 | 6,14 | 22,13 | 0,07 | 0,20 | 0,17 | 42,72 | 71,46 | 161,32 |
| C02 | 15,13 | 23,36 | 7,97 | 0,15 | 0,33 | 0,50 | 54,10 | 122,32 | 59,84 |
| C03 | 22,70 | 13,48 | 3,92 | 0,23 | 0,57 | 0,34 | 230,97 | 70,95 | 73,96 |
| C04 | 58,98 | 60,39 | 7,07 | 0,59 | 0,47 | 0,48 | 233,31 | 198,63 | 11,26 |
| C05 | 30,89 | 20,06 | 23,13 | 0,31 | 0,42 | 0,27 | 233,21 | 103,95 | 181,34 |
| C06 | 13,42 | 18,91 | 30,33 | 0,13 | 0,21 | 0,30 | 0,00 | 114,91 | 143,92 |
| D01 | 86,85 | 90,34 | 71,55 | 0,87 | 0,35 | 0,36 | 240,39 | 239,84 | 234,64 |
| D02 | 56,80 | 59,28 | 48,87 | 0,57 | 0,34 | 0,36 | 196,80 | 199,05 | 198,38 |
| D03 | 35,07 | 36,59 | 30,44 | 0,35 | 0,34 | 0,36 | 158,30 | 160,26 | 160,49 |
| D04 | 18,16 | 18,92 | 15,77 | 0,18 | 0,34 | 0,36 | 117,04 | 118,40 | 118,75 |
| D05 | 8,69 | 9,06 | 7,61 | 0,09 | 0,34 | 0,36 | 82,13 | 83,42 | 83,98 |
| D06 | 3,26 | 3,37 | 2,84 | 0,03 | 0,34 | 0,36 | 50,57 | 50,52 | 51,22 |
As we see, the RGB reference for our White is located at 240 239 234 and, for example, the middle gray at 117 118 118, values that indicate a high spectral uniformity of these neutral patches.
As we see in the image illustrating the introduction of this article, the values I obtain during development with ACR are very close to the expected values, which denotes a quite accurate exposure and white balance in-camera. We could make some adjustments in ACR to achieve closer proximity; however, we can leave that task to our ICC input profile.
