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. |
Mixes the color channels from an image into a single grayscale image using a weighted combination and then tints it |
last modified: December 15, 2018
USAGE: coloration [-h hue] [-s sat] [-l light] [-r red] [-g green] [-b blue]
-h ... hue ........ hue value to use for coloration; values are integers PURPOSE: To mix the color channels from an image into a grayscale image and tints it. DESCRIPTION: COLORATION mixes the color channels from an image into a single grayscale image using a weighted combination and then tints it in a manner similar to GIMP Colorize and using argument values similar to those used by GIMP. The script generates a color look up table (lut) and applies it against the grayscale version of the image. The lut can be saved, if desired, for future use and will have a size of 256x20 pixels. ARGUMENTS: -h hue ... HUE value to use for coloration. The values are integers either in the range 0 to 360(degrees) or 0 to 100(percent) depending upon the units argument. The default=0 (red). -s sat ... SAT is the saturation value to use for coloration. The values are integers in the range 0 to 100 (percent). The default=50. -l light ... LIGHT is the lightness value to use for coloration. The values are integers in range -100 to 100(percent). The default=0 is the normal amount of lightness. Larger values will use IM colorize to mix pure white with the result. Smaller values will use IM colorize to mix pure black with the result. -u units ... UNITS for specifying hue values. The choices are: raw (r) or percent (p). The default=raw -r red ... RED is the red mix percent (weight) in forming the grayscale image. Values are (pos. or neg.) floats. The default=29.9 is equivalent to IM non-linear grayscale. Nominally the r,g,b,o weights should total 100%. Weights are not relevant to form=desat. -g green ... GREEN is the red mix percent (weight) in forming the grayscale image. Values are (pos. or neg.) floats. The default=58.7 is equivalent to IM non-linear grayscale. Nominally the r,g,b,o weights should total 100%. Weights are not relevant to form=desat. -b blue ... BLUE is the red mix percent (weight) in forming the grayscale image. Values are (pos. or neg.) floats. The default=11.4 is equivalent to IM non-linear grayscale. Nominally the r,g,b,o weights should total 100%. Weights are not relevant to form=desat. -B bright ... BRIGHT is the percent change in brightness during processing. Values are floats in the range of -100 to 100. The default=10 (to match GIMP better). -C contrast ... CONTRAST is the percent change in contrast during processing. image. Values are floats in the range of -100 to 100. The default=-10 (to match GIMP better). 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. |
convert \( -size 151x151 xc:"rgb(100%,0%,0%)" -colorspace hsl \) \ |
![]() |
Original Image |
|||||
![]() |
|||||
Hue \ Sat and Light |
-s 50 -l 0 |
-s 25 -l 0 |
-s 75 -l 0 |
-s 50 -l -25 |
-s 50 -l 25 |
-h 0 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 30 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 60 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 90 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 120 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 150 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 180 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 210 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 240 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 270 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 300 |
![]() |
![]() |
![]() |
![]() |
![]() |
-h 330 |
![]() |
![]() |
![]() |
![]() |
![]() |
What the script does is as follows:
This is equivalent to the following IM commands for units=degrees.
|