3 Implementations for Adaptive Gamma Correction
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: 3 Implementations for Adaptive Gamma Correction
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: 3 Implementations for Adaptive Gamma Correction
Did you really mean -sparse-color bilinear and not -sparse-color barycentric? The bilinear option requires 4 points and you only have two.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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: 3 Implementations for Adaptive Gamma Correction
"-sparse-color bilinear" with only two points gives a linear gradient. See http://www.imagemagick.org/script/comma ... arse-color
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: 3 Implementations for Adaptive Gamma Correction
That page says
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.
So if two points it would be the same as using barycentric.bilinear
Like barycentric but for 4 points. Less than 4 points fall back to 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.