12-02-2022, 06:16 PM
Why do you need to write it since it is already written? Or you need to reproduce it? As far as I can tell the core is (gimp-drawable-color-balance drawable transfer-mode preserve-lum cyan-red magenta-green yellow-blue) with some heuristics (possibly using (gimp-drawable-histogram drawable channel start-range end-range) on each RGB channel) to determine how to change the color balance.