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. |
Converts the image into a series of uniform-colored spots. |
last modified: December 15, 2018
USAGE: spots [-s size] [-t type] [-p pad] [-b bgcolor] [-e edge] [-E ecolor] [-B brightness] [-C Contrast] infile [spotfile] outfile
-s .... size .......... spot size expressed as WxH in pixels; default=5x5 PURPOSE: Converts the image into a series of uniform-colored spots. DESCRIPTION: SPOTS converts the image into a series of uniform-colored spots. The shape of spots allowed are: circle (ellipse), square (rectangle) or diamond. The spot size may be adjusted. A colored edge may also be placed around each spot. An optional spotfile may be provided to define some other shape than those built-in. ARGUMENTS: -s size ... SIZE is the WxH dimensions of the spot cell. Values are a pair of positive integers separated by an x. The default=5x5. If only one value is provided, it will be used for both. This parameter is ignored if a spotfile is provided. -t type ... TYPE is the type of spot shape. The choices are: circle (or c), square (or s), diamond (or d). These may be asymmetric as ellipses or rectangles as controlled by the size parameters. This parameter is ignored if a spotfile is provided. -p pad ... PAD is the border around the spot cell. Values are integers>=0. The default=1. -b bgcolor ... BGCOLOR is the color to apply to the image between the spots. Any valid IM color is allowed. The default=black. -e edge ... EDGE is the thickness of the optional edge hightlight around the spot shape. Values are integers>=0. The default=0. -E ecolor ... ECOLOR is the color of the edge highlight. Any valid IM color is allowed. The default=gray. -B brightness ... BRIGHTNESS is the percent change in brightness of the spot colors. Values are integers. The default=0 -C contrast ... CONTRAST is the percent change in contrast of the spot colors. Values are integers. The default=0 The spotfile must be a binary mask with white for the shape and black for the background and no alpha channel. REQUIREMENTS: IM 6.3.6-1 or higher due to the use of -define distort:viewport=WxH+X+Y with -distort SRT. 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: -s 5x5 -t circle |
|
Arguments: -s 5x10 -t circle |
|
Arguments: -s 10x5 -t circle |
|
Arguments: -s 10x10 -t circle |
|
Arguments: -s 5x5 -t square |
|
Arguments: -s 7x7 -t diamond |
Original Image |
|
Arguments: -s 5x5 -t circle -B 20 -C 20 |
|
Arguments: -s 10x10 -t circle -B 20 -C 20 |
|
Arguments: -s 15x15 -t circle -B 20 -C 20 |
|
Arguments: -s 15x15 -t circle -B 20 -C 20 -e 1 -E gray |
|
Arguments: -s 15x15 -t diamond -B 20 -C 20 |
|
Arguments: -s 15x15 -t diamond -B 20 -C 20 -e 1 -E gray |
|
Arguments: -s 15x15 -t square -B 20 -C 20 |
|
Arguments: -s 15x15 -t square -B 20 -C 20 -e 1 -E gray |
|
Arguments: -B 20 -C 20 roundrectangle spotfile create as follows: convert -size 20x10 xc:black \ +antialias -fill white \ -draw "roundrectangle 0,0 19,9 5,3" \ -alpha off -bordercolor black -border 1 \ roundrect_spotfile.png |
What the script does is as follows:
This is equivalent to the following IM commands for the case where no spotfile is provided no border is used.
|