View Full Version : Gamma correction masktool expression
bxyhxyh
12th February 2014, 07:49
I need to use masktool for gamma correction. But I'm not experienced to write masktool expression.
Please convert it to masktool syntax.
Levels(0,2.5,255,0,255,coring=false)
feisty2
12th February 2014, 09:28
search "LUT" on google
bxyhxyh
12th February 2014, 10:12
I searched mt_lut gamma correction. But I couldn't find good result.
Gavino
12th February 2014, 12:15
Please convert it to masktool syntax.
Levels(0,2.5,255,0,255,coring=false)
mt_lut("x 255 / 1 2.5 / ^ 255 *", chroma="copy")
The expression corresponds to ((x/255)^(1/2.5))*255.
bxyhxyh
16th February 2014, 18:52
mt_lut("x 255 / 1 2.5 / ^ 255 *", chroma="copy")
The expression corresponds to ((x/255)^(1/2.5))*255.
Thanks,
How it would be for coring=true case?
Gavino
16th February 2014, 20:16
That was for the coring=false case, which is what you asked for before.
For coring=true, it would be:
mt_lut(yexpr="x 16 - 219 / 0 max 1 min 1 2.5 / ^ 219 * 16 +", expr="x 16 max 240 min", chroma="process")
or perhaps clearer:
mt_lut(yexpr=mt_polish("min(max((x-16)/219, 0), 1)^(1/2.5) * 219 + 16"), expr=mt_polish("min(max(x,16),240)", chroma="process")
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.