Although documentation is clear that the GUI RGB compositing tool and the CLI rgb_comp are different, I would appreciate if I could achieve the same results form a script that are yielded with the GUI. The composition with the GUI is less dull in the auto stretch view.
Researching the source code csr/gui/composing.c already revealed one difference in the linear_match min max settings (0.0000001 and 0.875) in the GUI and default for rgb_comp is 0, 0.92). When I apply those settings form a script the logged parameters from linear_match and the GUI are exactly the same. Yet the output of the GUI is much more appealing. In both situations I use the same color space settings.
I guess there is still some action in adjusting black level going on in the GUI, but my code reading skills are not that good. what is the additional step and can I replicate that with a script?
I was just a bit too early with asking for help. I may have under estimated my code reading skills. It appears that the GUI code maximises the pixel values at 1.0 before luminence is blended in (HSL) on the RGB composed pixels and then again after the HSL step. I can replicate this exactly with a script. Only tested for HSL.
# LRGB compositing method 2 - match to luminance and first composite RGB then LRGB
load r_C00
save mlr2_C00
load r_C01
linear_match r_C00 0.0000001 0.875
save mlr2_C01
load r_C02
linear_match r_C00 0.0000001 0.875
save mlr2_C02
load r_C03
linear_match r_C00 0.0000001 0.875
save mlr2_C03
rgbcomp mlr2_C01 mlr2_C02 mlr2_C03 -out=../temp_RGB
pm "iif($../temp_RGB$ > 1.0, 1.0, $../temp_RGB$)"
save ../tempclip_RGB
rgbcomp -lum=mlr2_C00 ../tempclip_RGB -out=../unclipped_LRGB2
pm "iif($../unclipped_LRGB2$ > 1.0, 1.0, $../unclipped_LRGB2$)"
save ../final_LRGB2
I tried to compare GUI and CLI script for HSV and that does not work wel. rgbcomp always keeps using HSL, despite the option -hsv. I went a bit further and the following line does not give an error: