Ok here we go:
davinci
loading history
dv> version()
"daVinci Version #2.10"
davinci -f rnc-color-stretch-v0.97.sh ~/Dokumente/bilder/dark/enfuse/enfuse-01.tif
.....
subtract 38060.0 from red to make red sky align with zero reference sky: 4096.0
subtract 39272.0 from green to make green sky align with zero reference sky: 4096.0
subtract 35748.0 from blue to make blue sky align with zero reference sky: 4096.0
now set the RGB sky zero level to 4096.0 4096.0 4096.0 DN out of 65535
root stretched image, power exponent= 0.166667 root iteration 1
scaled image stats, before color recovery, sky adjust pass 1:
RED: min=0 max=65535 mean=17730
GREEN: min=0 max=65535 mean=12325
BLUE: min=0 max=65535 mean=17523
computing RGB histograms on root stretched image and smoothing the histograms, pass 2, root iteration 1
Histogram peak, after root stretch, root iteration 1:
image histogram: DN Number of pixels in peak histogram bin
red: 17704 4750.986816
green: 10668 3453.402588
blue: 18744 5452.288086
histogram dark sky level on root-stretched image ( 6.0 % of max)
DN Number of pixels in histogram bin
red: 17108 285.059204
green: 10668 207.204147
blue: 18149 327.137268
subtract 13012.0 from red to make red sky align with zero reference sky: 4096.0
subtract 6572.0 from green to make green sky align with zero reference sky: 4096.0
subtract 14053.0 from blue to make blue sky align with zero reference sky: 4096.0
now set the RGB sky zero level to 4096.0 4096.0 4096.0 DN out of 65535
root stretched image, power exponent= 0.166667 root iteration 1
scaled image stats, before color recovery, sky adjust pass 2:
RED: min=0 max=65535 mean=7215
GREEN: min=0 max=65535 mean=6993
BLUE: min=0 max=65535 mean=5316
image stats after root stretch, bottom adjusted: min=0.000000 max=65535.007812 mean=21265.089844
root stretched image, power exponent= 0.166667, scaled image stats, before color recovery:
RED: min=0 max=65535 mean=7215
GREEN: min=0 max=65535 mean=6993
BLUE: min=0 max=65535 mean=5316
computing image ratios for color analysis
setting limits for color correction
Color ratio images after limit set 0.200000 to 1.000000
Color ratio: grratio = min= 0.200 max= 1.000 mean= 0.639
Color ratio: brratio = min= 0.200 max= 1.000 mean= 0.683
Color ratio: rgratio = min= 0.200 max= 1.000 mean= 0.824
Color ratio: bgratio = min= 0.200 max= 1.000 mean= 0.816
Color ratio: gbratio = min= 0.200 max= 1.000 mean= 0.700
Color ratio: rbratio = min= 0.200 max= 1.000 mean= 0.749
computing intensity dependent color correction
color correction intensity range factor: image stats: min=0.230769 max=1.000000 mean=0.644767
color correction cfe range factor: image stats: min=0.276923 max=1.200000 mean=0.773720
Color ratio images after factors applied
Color ratio: grratio = min= 0.105 max= 1.000 mean= 0.764
Color ratio: brratio = min= 0.105 max= 1.000 mean= 0.808
Color ratio: rgratio = min= 0.105 max= 1.000 mean= 0.922
Color ratio: bgratio = min= 0.109 max= 1.000 mean= 0.917
Color ratio: gbratio = min= 0.109 max= 1.000 mean= 0.820
Color ratio: rbratio = min= 0.105 max= 1.000 mean= 0.866
computing 6 intermediate possible image sets for color correction
starting signal-dependent color recovery
starting line 1 of 4028
line 1 af[3015,iy,1] orig-sky RGB= 9233 7843 8524
line 1 c[3015,iy,1] corrected RGB= 5484 5689 7089
starting line 1001 of 4028
line 1001 af[3015,iy,1] orig-sky RGB= 12182 9960 9555
line 1001 c[3015,iy,1] corrected RGB= 12834 9461 8752
starting line 2001 of 4028
line 2001 af[3015,iy,1] orig-sky RGB= 14059 12342 10845
line 2001 c[3015,iy,1] corrected RGB= 16768 13969 11411
starting line 3001 of 4028
line 3001 af[3015,iy,1] orig-sky RGB= 13522 9960 10071
line 3001 c[3015,iy,1] corrected RGB= 15691 9857 10016
starting line 4001 of 4028
line 4001 af[3015,iy,1] orig-sky RGB= 9233 7843 8524
line 4001 c[3015,iy,1] corrected RGB= 5484 5689 7089
color recovery complete
computing RGB histograms on root stretched image and smoothing the histograms
Histogram peak, after root stretch, color corrected:
image histogram: DN Number of pixels in peak histogram bin
red: 13126 3462.753662
green: 8076 4513.583984
blue: 7387 5084.537598
histogram dark sky level on root-stretched image ( 6.0 % of max)
DN Number of pixels in histogram bin
red: 12535 207.765213
green: 7535 270.815033
blue: 6790 305.072235
now set the root-stretched sky level to 4096.0 DN out of 65535
subtracting 3439.000000 from R, G, and B
root stretched image, power exponent= 0.166667, scaled image stats, after color recovery:
RED: min=0 max=65535 mean=4928
GREEN: min=0 max=65535 mean=3836
BLUE: min=0 max=65535 mean=2712
stretched image stats, final image:
RED: min=0 max=65535 mean=4928
GREEN: min=0 max=65535 mean=3836
BLUE: min=0 max=65535 mean=2712
output image dimnsions: 6030 4028 4
writing 16-bit results image a-stretched-image.png
NOTE: image is 0-32765. You will need to scale it 2x, e.g. with levels tool in photoshop
With levels tool in photoshop or other editor, change the right slider from 255 to 128
then save as 16-bit tiff for further processing
writing 8-bit results jpeg image a-stretched-image.jpg
XXXXXXXXX
But no a-stretched-image in the current directory.