## WHITEBALANCING

 Applies white balancing to an image according to a gray world method in LAB colorspace.

### EXAMPLES

 Example 1 Arguments: (defaults) Animation: Original vs Balanced (source)

 Example 2 Arguments: (defaults) Animation: Original vs Balanced (source)

 Example 3 Arguments: (defaults) Animation: Original vs Balanced (source)

 Example 4 Arguments: (defaults) Animation: Original vs Balanced (source)

 Example 5 Arguments: (defaults) Animation: Original vs Balanced (source)

 Example 6 Arguments: (defaults) Animation: Original vs Balanced

 Example 7 Arguments: -v 20 Animation: Original vs Balanced/Enhanced7 (source)
 Example 8 Arguments: -v 20 -b 20 Animation: Original vs Balanced/Enhanced7 (source)

 What the script does is as follows: Converts the image to LAB colorspace Computes the differences of the means of channels A and B from 0.5 Multiplies the L channel by the differences and subtracts the results from the original A and B channels Converts the L and changed A and B channels back to sRGB colorspace This is equivalent to the following IM commands. convert \$tmpA1 -colorspace LAB -separate +channel \$tmpA2 meanA=`im7 magick \$tmpA2[1] -format "%[fx:(mean-0.5)]" info:` meanB=`im7 magick \$tmpA2[2] -format "%[fx:(mean-0.5)]" info:` convert \$tmpA2[0] +write mpr:lum \ \( \$tmpA2[1] \( mpr:lum -evaluate multiply \$meanA \) +swap -define compose:clamp=off \ -compose minus -composite \) \ \( \$tmpA2[2] \( mpr:lum -evaluate multiply \$meanB \) +swap -define compose:clamp=off \ -compose minus -composite \) \ -set colorspace LAB -combine -colorspace sRGB \ "\$outfile"