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 color channels from an image into a grayscale image and optionally tints it |
last modified: December 15, 2018
USAGE: graytoning [-r red] [-g green] [-b blue] [-o offset] [-c contrast] [-t tintcolor] [-m mode] [-a amount] infile outfile
-r ... red ......... red mix percent; float; default=29.9 PURPOSE: To mix color channels from an image into a grayscale image and optionally tint it. DESCRIPTION: GRAYTONING mixes color channels from an image into a grayscale image and optionally tints it. Tint modes allow selective tinting of: all, midtones, hightlights or shadows. Arguments: -r red ... RED is the red mix percent in forming the grayscale image. Values are floats. The default=29.9 (equivalent to IM standard grayscale or Rec609Luma. -g green ... GREEN is the red mix percent in forming the grayscale image. Values are floats. The default=58.7 (equivalent to IM standard grayscale or Rec609Luma. -b blue ... BLUE is the red mix percent in forming the grayscale image. Values are floats. The default=11.4 (equivalent to IM standard grayscale or Rec609Luma. -o offset ... OFFSET is the gray offset or brightness percent change. Values are -100<=float<=100. The default=0. -c contrast ... CONTRAST is the gray contrast percent change. Values are -100<=float<=100. The default=0. -t tintcolor ... TINTCOLOR is the color for tinting the grayscale image. Any valid opaque IM color is allowed. The default is no tinting. -m mode ... MODE is the mode of tinting. Choices are: all (a), midtones (m), highlights (h) and shadows (s). The default=midtones. -a amount ... AMOUNT is the amount of tinting. Values are 0<=integer<=100. The default=40. 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. |
Example 1 -- Convert To Grayscale |
||
Original Image |
||
Arguments: |
Arguments: |
Arguments: |
Example 1 -- Convert To Grayscale And Tint |
|||
Original Image |
|||
Arguments: |
Arguments: |
-r 30 -g 60 -b 10 |
-r 30 -g 60 -b 10 |
Example 1 -- Convert To Grayscale And Tint |
||||
Original Image |
||||
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
What the script does is as follows:
This is equivalent to the following IM commands for the case of
|