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. |
Isolates a particular color in an image. |
last modified: December 15, 2018
USAGE: isolatecolor [-c fcolor] [-C bcolor] [-t toler ] [-s fsat] [-S bsat ] infile outfile
-c ... fcolor ... hue value or color from which to extract the hue PURPOSE: To isolate a particular color in an image. DESCRIPTION: ISOLATECOLOR isolates a particular color in an image by thresholding on the corresponding hue value. ARGUMENTS: -c fcolor ... FCOLOR is the hue value or color from which to extract the hue value for the isolated color (foreground). Any IM color value is allowed. The hue values are 0<=hue<=360. The default=red. -C bcolor ... BCOLOR is the hue value or color from which to extract the hue value for the rest of the image (background). Any IM color value is allowed. The hue values are 0<=hue<=360. The default is the background coloring as defined by bsat. -t toler ... TOLER is the hue tolerance (fuzz value) for the foreground. Values are 0<=float<=50. The default=10. -s fsat ... FSAT is the saturation of the foreground region. Values are integer>=0. The default=100 (no change). -S bsat ... BSAT is the saturation of the background region. Values are integer>=0. The default=0 (grayscale). When background color is specified, a nominal value for bsat is about 25. 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 \) \ |
Example 1 |
Original Image |
|
Arguments: -c red -t 10 -S 0 -s 100 (defaults) |
Example 2 |
Original Image |
|
Arguments: -c green1 -t 8 -S 0 -s 100 |
|
Arguments: -c green1 -t 8 -S 0 -s 300 |
|
Arguments: -c green1 -t 8 -C 30 -S 25 -s 100 |
Example 3 |
Original Image |
|
Arguments: -c blue -t 20 -S 0 -s 100 |
|
Arguments: -c blue -t 20 -S 20 -s 100 |
What the script does is as follows:
This is equivalent to the following IM commands
|