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 six-alphanumeric-character image for use as a challenge response test |
last modified: December 15, 2018
USAGE: captcha [-f font] [-p pointsize] [-t textcolor] [-u undercolor] [-b bordercolor] [-m mode] [-a angle] [-r resize] outfile
-f .... font .............. fontname or path-to-font-file; default=TimesNewRoman PURPOSE: To create a six-alphanumeric-character image for use as a challenge response test. DESCRIPTION: CAPTCHA creates a six-alphanumeric-character image for use as a challenge response test. It builds a default image of size 300x80 pixels containing 6 alphanumeric characters that are randomly positioned and oriented and overlaid with random curved and straight lines segments. ARGUMENTS: -f font ... FONT is the desired font or path-to-font-file for the text. The default is TimesNewRoman. -p pointsize ... POINTSIZE is the desired pointsize for the font. The default is 40. -t textcolor ... TEXTCOLOR is the color to apply to the text. Any valid IM text color may be used. The default is black. See http://imagemagick.org/script/color.php -u undercolor ... UNDERCOLOR is the background color to apply directly under the text. Any valid IM text color may be used. The default is white. See http://imagemagick.org/script/color.php -b bordercolor ... BORDERCOLOR is the color to apply to the image border. Any valid IM text color may be used. The default is black. See http://imagemagick.org/script/color.php -m mode ... MODE is the mode for randomly orienting the text. The choices are: skew, rotate or both. -a angle ... ANGLE is the maximum angle to use to randomly orient the text. The default=40 (degrees). Values are integers, 0<=angle<=60 -r resize ... RESIZE is the percentage of the default output image size of 300x80 to use to generate the output image. The default is 100 (percent). All images are created at a size of 300x80, including a 5 pixel border. If resize is specified, the output image will be resized accordingly by a post-processing step using the IM -resize function. 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. |
Examples |
|
Arguments: (default) |
|
Arguments: (default) |
|
Arguments: -f TimesNewRoman -p 40 -t blue -u white -b red -m skew -a 40 -r 100 |
|
Arguments: -f TimesNewRoman -p 40 -t blue -u white -b red -m skew -a 40 -r 100 |
What the script does is as follows:
This is equivalent to the following IM commands for the case of the default settings:
|