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. |
Thresholds an image (inclusively) between a range of graylevels and optionally colorizes inside and/or outside the threshold range. |
last modified: December 06, 2023
USAGE: slice blackpt,whitept [-m mode] [-i icolor] [-e ecolor] infile outfile
blackpt,whitept ...... low and high thresholds; integers in range 0-255 PURPOSE: To threshold an image between a range of graylevels and optionally colorizes inside and/or outside the threshold range. DESCRIPTION: SLICE thresholds an image (inclusively) between a range of graylevels and optionally colorizes inside and/or outside the threshold range. The inclusive range of graylevels may be set to any non-transparent color, transparent or left as image coloration. Similarly the exclusive range of color may be set to any non-transparent color, transparent or left as image coloration. If the input image has transparency, the transparent channel will be extracted and recombined with the output image. This will supercede any transparency used in the processing. ARGUMENTS: blackpt,whitept ... BLACKPT,WHITEPT are the low and high threshold values used to determine the inclusive range and corresponding coloration. Values are restricted to integers between 0 and 255 when mode=8, between 0 and 65535 when mode=16, and floats between 0 and 100 when mode=P (for percent). -m mode ... MODE is the numerical mode for specifying the threshold values. Values are restricted to integers between 0 and 255 when mode=8, between 0 and 65535 when mode=16, but floats between 0 and 100 are allowed when mode=P (for percent). Default=8 for Q8; otherwise 16 for Q16 or Q32 -i icolor ... ICOLOR is the color to be used inclusive to the threshold range. Any valid IM non-transparent color specification is allowed. One may also use 'none' to specify fully transparent or 'image' to leave the image coloration. Default=white -e ecolor ... ECOLOR is the color to be used exclusive to the threshold range. Any valid IM non-transparent color specification is allowed. One may also use 'none' to specify fully transparent or 'image' to leave the image coloration. Default=black NOTE: If the input has transparency, the transparency channel will be removed, saved, the image processed without it and then combined back at the end. This will supercede the use of any transparency used in the processing. 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. |
Gradient |
|||||
Arguments: |
Arguments: |
Arguments: |
|||
Arguments: |
Arguments: |
Arguments: |
|||
Arguments: |
Arguments: |
Arguments: |
|||
Arguments: |
Arguments: |
Arguments: |
|||
Arguments: |
Arguments: |
Arguments: |
|||
Arguments: |
Arguments: |
Arguments: |
|||
Lena |
|||||
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
|