Fred's ImageMagick Scripts



    Licensing:

    Copyright © Fred Weinhaus

    My scripts are available free of charge for non-commercial (non-profit) use, ONLY.

    For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net.

    If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment.

    Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php

    Please read the Pointers For Use on my home page to properly install and customize my scripts.

COLORBOOST


Enhances the color in an under saturated image.

Download Script

last modified: December 15, 2018



USAGE: colorboost [-f fact] infile outfile
USAGE: colorboost [-h or -help]

-f ... fact ... color boost blending factor; 0<=integer<=100; default=0

PURPOSE: To enhance the color in a under saturated image.

DESCRIPTION: COLORBOOST enhances the color in an under saturated image. It first creates an image that is the log of the ratio of the original image to its grayscale version. This is then multiplied by the original image to form a strongly color boosted image. Finally the original image is blended with the strongly color boosted image to generate the output.

ARGUMENTS:

-f fact ... FACT specifies the color boost blending percentage. Values for fact may be an integer between 0 and 100. A value of 0 indicates no color boost. A value of 100 indicates full color boost. The default=0

Note: due to the use of -fx, this script may be a little slow.

Reference: http://visl.technion.ac.il/1999/99-07/www/

CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk.


EXAMPLES


Variation In Boost Factor

Original Image

Arguments:
-f 25

Arguments:
-f 50

Arguments:
-f 75

Arguments:
-f 100



What the script does is as follows:

  • Creates an image that is the log of the ratio of the original
    image to its grayscale version
  • Multiplied that by the original image to form a strongly color
    boosted image
  • Blends the original with the strongly color boosted image to
    generate the output

This is equivalent to the following IM commands:

  • convert $infile \( +clone -colorspace Gray \) -fx "log((u/max(v,.000001))+1)" $tmpA1
  • convert $infile $tmpA2 -compose multiply -composite -normalize $tmpA1
  • convert $infile $tmpA1 -define compose:args=$fact% -compose blend -composite $outfile