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. |
Creates a two-color gradient with adjustable mid-color location. |
last modified: May 15, 2020
USAGE: midgradient [-l length] [-t thickness] [-c1 color1] [-c2 color2]
[-d direction] [-o offset] outfile
-l ... length ...... length in pixels along the gradient; integer>0; PURPOSE: To create a two-color gradient with adjustable mid-color location. DESCRIPTION: MIDGRADIENT creates a two-color gradient with adjustable mid-color location. The gradient can vary, up/down or left/right according to a direction or rotation angle relative to 0 upwards from color1 to color2. ARGUMENTS: -l length ... LENGTH in pixels along the gradient. Values are integers>0. The default=256. -t thickness ... THICKNESS in pixels of the gradient. Values are integers>0. The default=50. -c1 color1 ... COLOR1 is the color at start of gradient. Any valid Imagemagick color is allowed. The default=red. -c2 color2 ... COLOR2 is the color at end of gradient. Any valid Imagemagick color is allowed. The default=blue. -d direction ... DIRECTION angle of the gradient relative to the default direction of 0 pointing upward. Choices are integer of 0, 90, 180 or 270. The default=0. -o offset ... OFFSET point in percent along gradient of mid-color (equal blend of color1 and color2). Values are 0<=integers<=100. The default=50 (middle of the gradient). 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 |
Arguments: -d 90 -o 25 -c1 red -c2 blue |
![]() |
Arguments: -d 90 -o 50 -c1 red -c2 blue |
![]() |
Arguments: -d 90 -o 75 -c1 red -c2 blue |
![]() |
What the script does is as follows:
|