GIMP shadows and highlights correction algorithm

Viewed 270

I'm doing shadows correction as part of ongoing project and wanted to adopt the GIMP algorithm. I found an implementation (in Python) on GitHub here and after some search I found the GIMP source code (in C) here in which there's a note that it's a port of darktable. I looked up darktable source code and found it here (the function definition begins at line 321).
To the best of my knowledge, the algorithm is based on modifying the values in the luminance channel. And based on the code in either implementation, it's basically:

y = (1-a)x + (a)(b)

where x is the input luminance and y is the output corrected one while a and b are some functions of the input parameters. However, I don't understand the reasoning behind the code. Is there any publication that explains this algorithm or the math behind it? (also to cite in my work)
Neither the GIMP documentation nor the darktable one explains the algorithm

0 Answers
Related