Currently, I am exploring the realm of 3D color LUTs (color lookup tables) in JavaScript and have been pondering if there exists a method to merge multiple 3D LUTs together for export in a unified file. Allow me to elaborate:
Upon obtaining a .cube file (3D color lookup), I parse it, extract the color values, store them in an array, and apply them to an image. Subsequently, I superimpose a new 3D LUT onto the modified image, followed by another application of a different LUT. Consequently, the original image now showcases the cumulative effect of three distinct 3D LUTs applied successively.
While I can readily export each individual 3D LUT into separate files for download, I am faced with the challenge of amalgamating them into one cohesive .cube file. It appears that devising an algorithm for the "combination" of diverse LUTs is imperative.
To illustrate, here is a comparison with how this process is executed in Photoshop:
LUT1:
0.024536 0.000183 0.000244
0.049103 0.000336 0.000458
LUT2:
0.041260 0.021149 0.009125
0.067230 0.023804 0.009125
COMBINED LUT (result):
0.035034 0.020660 0.009308
0.054810 0.022766 0.009430
Your insights or suggestions on achieving this desired merging of LUTs would be greatly appreciated!