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 drop shadows to an image. |
last modified: December 15, 2018
USAGE: shadows [-t type] [-c color] [-r radius] [-s sigma] [-d direction]
[-b bgcolor] [-a alpha] infile outfile
-t ... type ........ type of shadow; inner (i) or outer (o); default=inner PURPOSE: To apply drop shadows to an image. DESCRIPTION: SHADOWS applies drop shadows to an image that has an alpha channel. The alpha channel should be binary or at worst binary but anti-aliased. If there is no alpha channel or the alpha channel is full opaque, then the no shadow will be created. The inner shadow will appear at the inside edges of the white part of the alpha channel. The outer shadow will appear at the outside edges of the white part of the alpha channel. In either case, the result will have the alpha channel removed to show the colors under the alpha channel. There is an option for the inner shadow to keep the alpha channel enabled. Note that the inner shadow may look like an outer bevel. This is an optical illusion. ARGUMENTS: -t type ... TYPE of shadow. The choices are: inner (i) or outer (o). The default=inner. -c color ... COLOR of shadow; any valid Imagemagick opaque color may be used. The default=black. -r radius ... RADIUS of the shadow. Values are integer>=0. The default=0. The actual value will be deterined from the sigma value. -s sigma ... SIGMA (blur) of the shadow. Values are float>=0. The default=5. -d direction ... DIRECTION of the shadow. Values are -360<=integer<=360 measure clockwise from the positive x axis. The default=135. -b bcolor ... (background) BCOLOR to put under the alpha channel. Any valid Imagemagick opaque color may be used. The default is not to replace the image texture with color. -a alpha ... ALPHA flag to specify whether to leave the alpha channel enabled or not. Values are on or off. The default=off. This option is only allowed for type=inner. 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 |
Original |
Original Without Alpha Channel |
Original Alpha Channel |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
What the script does is as follows for border=black at the top/bottom edges:
This is equivalent to the following IM commands
|