Arcsinh stretch
Posted: 04 Dec 2018, 13:48
Hi,
I'm trying to work out how to apply an arcsinh stretch to an an image, please can I have some help.
So far I've been approaching this using the formula commnd but my current effort reduce the histogram rather than stretch, what formula shoudld I be applying?
v = asinh(v * 0.007)
I’ve found this paper on image stretching http://web.ipac.caltech.edu/staff/fm...olorLupton.pdf which explains how arcsinh should be used (equally how other logarithmic equations could be used).
To summary the paper:
The key equation appears to be F(x) = asinh(aQ(x - m))/Q
Key
M High visualisation threshold (white point)
m Lower visualisation threshold (Black point)
Q Intensity ( should be 1 if black point has been set correctly)
a Stretch coefficient
x Pixel value
l sum of r + g + b pixel values
Target = (r,g,b) values for a single pixel.
So in semi pseudo code as I’m not sure whether I can do scripting syntax in the function command
A = 0.0001;
Q = 1;
r = $target[0];
g = $target[1];
b = $target[2];
l = r+g+b/3;
ls = ArcSinh(Q*a*(l-m))/a;
$target*ls/l
The problem I have is I don’t know how to access the different parameters or whether the current scripting language would support this.
The colour stretch functionality already available offers something similar it would be excellent if there was the option to apply various functions dynamically.
I'm trying to work out how to apply an arcsinh stretch to an an image, please can I have some help.
So far I've been approaching this using the formula commnd but my current effort reduce the histogram rather than stretch, what formula shoudld I be applying?
v = asinh(v * 0.007)
I’ve found this paper on image stretching http://web.ipac.caltech.edu/staff/fm...olorLupton.pdf which explains how arcsinh should be used (equally how other logarithmic equations could be used).
To summary the paper:
The key equation appears to be F(x) = asinh(aQ(x - m))/Q
Key
M High visualisation threshold (white point)
m Lower visualisation threshold (Black point)
Q Intensity ( should be 1 if black point has been set correctly)
a Stretch coefficient
x Pixel value
l sum of r + g + b pixel values
Target = (r,g,b) values for a single pixel.
So in semi pseudo code as I’m not sure whether I can do scripting syntax in the function command
A = 0.0001;
Q = 1;
r = $target[0];
g = $target[1];
b = $target[2];
l = r+g+b/3;
ls = ArcSinh(Q*a*(l-m))/a;
$target*ls/l
The problem I have is I don’t know how to access the different parameters or whether the current scripting language would support this.
The colour stretch functionality already available offers something similar it would be excellent if there was the option to apply various functions dynamically.