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 one or two thresholds to an image. |
last modified: December 16, 2018
USAGE: thresholds [-l lowthresh] [-h highthresh] [-u units] [-t type]
[-M midvalue] [-L lowvalue] [-H highvalue] [-P profile] infile outfile
-l ... lowthresh ... low threshold in range of units; default=0 (percent) PURPOSE: To apply one or two thresholds to an image. linear endpoints. DESCRIPTION: ENDPOINTS applies one or two thresholds to an image. The types of thresholds allowed are: hard, soft and clipped. Units for the thresholds may be any of: percent, 8-bit values or 16-bit values. ARGUMENTS: -l lowthresh ... LOWTHRESH is the low threshold in the range of the specified units. The default=0 (percent). -h highthresh ... HIGHTHRESH is the high threshold in the range of the specified units. The default=100 (percent). -u units ... UNITS to use for lowpt and highpt values. The choices are: percent (p) for the range 0 to 100, 8bit (8) for the range of 0 to 255 or 16bit (16) for the range 0 to 65535. The default=percent. -t type ... TYPE of thresholds. The choices are: hard (h), soft (s) or clipped (c). The default=hard. -M midvalue ... MIDVALUE is the mid (output) graylevel value in the specified units for type=clipped. The default is no value. -L lowvalue ... LOWVALUE is the low (output) graylevel value in the specified units. It is used only for type=clipped and when the midvalue is supplied. The default=0 (percent). -H highvalue ... HIGHVALUE is the high (output) graylevel value in the specified units. It is used only for type=clipped and when the midvalue is supplied. The default=100 (percent). -P profile ... PROFILE allows the option to view (v) or save (s) the profile graph. The profile will be named from the input file with _profile.gif appended. The default is neither. Requires my script, plot. REQUIREMENTS: my script, plot, is needed to use the -P option. 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 1 -- Gradient |
||
Arguments: |
Image |
Profile |
Original |
![]() |
![]() |
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 for type=clipped and two thresholds
|