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. |
Applies a color tint to the mid-range of a grayscale image |
last modified: December 16, 2018
USAGE: tintilize [-m mcolor] [-c contrast] [-o offset] [-t type] infile outfile [lutfile]
-m .... mcolor ........... Color for mid range of grayscale; Any valid IM color is allowed; PURPOSE: To apply a color tint to the mid-range of a grayscale image. DESCRIPTION: TINTILIZE applies a color tint to the mid-range of a grayscale image. If the input image is color, it will be converted to grayscale first. 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: -m mcolor ... MCOLOR is the color to use in the mid grayscale range. The default=gray50. Any valid IM color is allowed. See http://imagemagick.org/script/color.php For tinting, a good choice of colors may be specified as hsl with saturation about 25% and lightness about 50% and your choice of hue in range 0 to 360 degrees. For reference, see http://homepages.cwi.nl/~steven/css/hsl-examples.html -c contrast ... CONTRAST is the percent change in color contrast. Values are integers such that -100<=contrast<=100. The default=0. -o offset ... OFFSET is the percent shift of the colors in the lut. Values are integers such that -100<=offset<=100. Positive values shift the colors towards the brighter end of the grayscale and negative values shift the colors towards the darker end of the grayscale. The default=0. -t type ... TYPE of smoothing/interpolation of the colors to fill out the look up table. The choices are: cubic, gaussian, quadratic and triangle. The default=quadratic. IMPORTANT: Prior to IM 6.5.6-6, hue was specified in the range of 0-360, when saturation and lightness/brightness were either in the range of 0-255 or 0%-100%. Afterwards, hue was specified as percent when saturation and lightness/brightness were percent. 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. |
Variations In Tint Color |
|||
|
Original Image |
|
Original Image |
![]() |
![]() |
||
|
Grayscale Image |
|
Grayscale Image |
![]() |
![]() |
||
Arguments: |
Tinted Image |
Color LUT Image |
Tinted Image |
-m "hsl(0,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(30,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(60,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(90,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(120,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(150,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(180,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(210,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(240,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(270,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(300,25%,50%)" |
![]() |
![]() |
![]() |
-m "hsl(330,25%,50%)" |
![]() |
![]() |
![]() |
Variation In Smoothing/Interpolation Type |
||
|
Original Image |
Grayscale Image |
![]() |
![]() |
|
Arguments |
Tinted Image |
LUT Image |
-m "hsl(60,25%,50%)" -t cubic |
![]() |
![]() |
-m "hsl(60,25%,50%)" -t quadratic |
![]() |
![]() |
-m "hsl(60,25%,50%)" -t gaussian |
![]() |
![]() |
-m "hsl(60,25%,50%)" -t triangle |
![]() |
![]() |
Variation In Contrast |
||
|
Original Image |
Grayscale Image |
![]() |
![]() |
|
Arguments |
Tinted Image |
LUT Image |
-m "hsl(60,25%,50%)" -c -20 |
![]() |
![]() |
-m "hsl(60,25%,50%)" -c 0 |
![]() |
![]() |
-m "hsl(60,25%,50%)" -c 20 |
![]() |
![]() |
Variation In Offset |
||
|
Original Image |
Grayscale Image |
![]() |
![]() |
|
Arguments |
Tinted Image |
LUT Image |
-m "hsl(60,25%,50%)" -o -10 |
![]() |
![]() |
-m "hsl(60,25%,50%)" -o 0 |
![]() |
![]() |
-m "hsl(60,25%,50%)" -o 10 |
![]() |
![]() |
What the script does is as follows:
This is equivalent to the following IM commands for the luminance colormode.
|