Page 2 of 2

Re: 3 Implementations for Adaptive Gamma Correction

Posted: 2018-11-19T10:26:22-07:00
by fmw42
Your evaluate pow is the same as -auto-gamma except you use 0.3 and auto-gamma is limited to 0.5. It was my intention that -auto-gamma be modified to have a -define to allow that value (0.5) to be modified. My autogamma script is like your use of evaluate pow. It allows the value to be set as desired.

Re: 3 Implementations for Adaptive Gamma Correction

Posted: 2018-11-19T12:19:19-07:00
by fmw42
snibgo wrote:%IM7DEV%magick ^
%SRC% ^
+write mpr:INP ^
-process 'mkhisto verbose' ^
-auto-level ^
-evaluate Pow %alpha% ^
-process 'cumulhisto norm verbose' ^
-negate ^
-evaluate Divide %%[fx:QuantumRange] ^
( +clone ^
-sparse-color bilinear 0,0,Black,%%[fx:w-1],0,White ^
) ^
-evaluate-sequence Pow ^
mpr:INP ^
+swap ^
-clut ^
out3.png
Did you really mean -sparse-color bilinear and not -sparse-color barycentric? The bilinear option requires 4 points and you only have two.

Re: 3 Implementations for Adaptive Gamma Correction

Posted: 2018-11-19T12:51:51-07:00
by snibgo
"-sparse-color bilinear" with only two points gives a linear gradient. See http://www.imagemagick.org/script/comma ... arse-color

Re: 3 Implementations for Adaptive Gamma Correction

Posted: 2018-11-19T12:57:17-07:00
by fmw42
That page says
bilinear
Like barycentric but for 4 points. Less than 4 points fall back to barycentric.
So if two points it would be the same as using barycentric.

The reason I asked was that I kept getting an error in number of argument for -sparse-color bilinear when I only had two points.