Color correction, comparison sRGB/L*a*b*

This article follows that article about color correction using a QP203 color chart.

After studying more about color spaces I understood that, 1) using sRGB color space works against the linear transformation of the color correction due to the non linearity coming from the gamma correction, 2) using the Euclidean distance as the fitness function works better if the color space is uniform as it equally weights the color difference over the whole space. The L*a*b* color space is supposed to solve these two issues. Well, according do Wikipedia "While the intention behind CIELAB was to create a space that was more perceptually uniform than CIEXYZ using only a simple formula, CIELAB is known to lack perceptual uniformity, particularly in the area of blue hues." but...

The patent of the QP203 color chart gives the reference values in the L*a*b* color space (exactly CIE LAB 1976 D50 2 degrees). I've explained in the article about color spaces how to translate these values to sRGB. Doing so revealed that 9 of the color patches are actually outside the sRGB gamut. On the image below I've punched a "hole" on those patches.

Given that I want to use that color space (it is the one my camera works in), that's a bummer! Anyway there's nothing I can do about it and will ignore those patches and work with the remaining 26 ones instead.

Using L*a*b* I can now revise my method for brightness correction: it's just fixing the L* values in the reference chart to the ones of the image chart. That seems much more accurate than the scaling I was using before.

The color correction algorithm then becomes: start with the L*a*b* reference values, convert the color chart extracted from the image to L*a*b*, if no brightness correction is requested force the L* value in the reference to the one in the extracted chart, find the correction matrix, and finally apply that matrix to the image converted in L*a*b* space. I modified accordingly my color correction tool, leaving the option to choose in which color space the correction matrix calculation is done for comparison.

Results are as follow. Images are, from top to bottom, the original image, the sRGB corrected image, the L*a*b* corrected image, without brightness correction.




For objective comparison I define the similarity value as one minus the average Euclidean distance between the sRGB colors in the image patches and reference patches (higher is better):

imageinitial similarityfinal similarity (sRGB)final similarity (L*a*b*)
#000.93670.94960.9524
#010.93360.95810.9587
#020.91400.92430.9371
#030.84010.93840.9313
#040.88930.91920.9409
#050.92660.95010.9526
#060.61020.89930.8807
#070.72420.92600.9179
#080.89240.94450.9460

If applying brightness correction, the results become as follow.




imageinitial similarityfinal similarity (sRGB)final similarity (L*a*b*)
#000.88460.93220.9274
#010.73610.88680.8884
#020.69280.92960.9221
#030.70970.87610.8769
#040.46120.86260.8518
#050.88800.93280.9266
#060.61520.89910.8643
#070.74300.91980.8991
#080.85810.92560.9229

Using L* to control brightness clearly gives better results. As it is applied for both sRGB and L*a*b* correction, before the correction matrix, it helps in both case. Without brightness correction, the result of correction is visually pleasing, the images were clearly improved in both color spaces. There is no big difference between the two color spaces, but the similarity value shows that the correction made using L*a*b* corlor space is slightly better except for images #06 and #07. Those are the two images biased toward blue, it makes me wonder if that's related to what they are speaking of in the Wikipedia article.

If using brightness correction, results are not quite as I would have expected. According to the similarity value there is an improvement. It is better if sRGB is used rather than L*a*b*. But visually, it isn't pleasing at all.

In conclusion, using L*a*b* was an improvement from the previous implementation from the point of view of brightness matching. To calculate the correction matrix itself it doesn't make a big difference. If color correction does work as expected, brightness correction doesn't and needs to be improved.

2022-04-12
in All, Computer graphics,
24 views
Copyright 2021-2022 Baillehache Pascal