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. |
Locates in the image the first location and/or last location for the closest pixel within the fuzz value to the color specified. |
last modified: December 15, 2018
USAGE: colorcoords [-c color] [-m mode] [-f fuzzval] infile
-c ... color ..... Any valid IM color specification; default=white PURPOSE: To locate in the image the first location and/or last location for the closest pixel within the fuzz value to the color specified DESCRIPTION: COLORCOORDS locates in the image the first location and/or last location for the closest pixel within the fuzz value to the color specified. ARGUMENTS: -c color ... COLOR is any valid IM color specification, including RGB, HEX, HSL, HSB, CMYK or by name. If not a color name, the color specification should be enclosed in quotes. -m mode ... MODE is the output coordinate location mode: choices are: first (f) or last (l) or both (b). The default=first. -f fuzzval ... FUZZVAL is the fuzz value in percent for locating nearest color. Values must be floats between 0 and 100. The default=0 NOTE: Prior to IM 6.5.6-6, HSL/HSB colors may not work correctly, as changes and bugs were fixed starting with IM 6.5.6-4. Prior to IM 6.5.6-4, HSL colors were specified only with hue in range 0-360 and saturation and lightness as percentages. HSB color specification and swatches were only first available and correct starting with IM 6.5.6-6. For current color specifications, see http://www.imagemagick.org/script/color.php 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. |
Original Image |
|
Arguments |
Image With Coordinates Marked |
-c "rgb(234,43,44)" -m both -f 0 First Location = 70,23 Last Location = 154,225 |
|
Arguments |
Image With Coordinates Marked |
-c "rgb(234,43,44)" -m both -f 15 First Location = 79,20 Last Location = 221,230 |
What the script does is as follows:
This is equivalent to the following IM commands:
|