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 cosine-bell-shaped tapered alpha channel in an image and optionally blends the image into a background image. |
last modified: December 15, 2018
USAGE: cosinebell [-r rolloff] [-g gravity] [-o offsets]
infile1 [infile2] outfile
-r ... rolloff ... rolloff percent (percent distance from the center of the PURPOSE: Creates a cosine-bell-shaped tapered alpha channel in an image and optionally blends the image into a background image. DESCRIPTION: COSINEBELL creates a cosine-bell-shaped tapered alpha channel in an image and optionally blends the image into a background image. ARGUMENTS: -r rolloff ... ROLLOFF (taper) percent (percent distance from the edge of the image to the image center where the alpha channel drops to 50% amplitude. Values are 0<=integer<=100. Nominal values are 10 to 30. The default=30. -g gravity ... GRAVITY setting for compositing the smaller image into the larger image. Any valid IM gravity setting is allowed. The default=northwest. -o offsets ... x and y OFFSETS relative to the gravity for compositing the smaller image into the larger image. These are geometry-like values, +-X+-Y in pixels. The default=+0+0 The foreground (infile1) must not be larger than the background image (infile2). 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 -- Tapered Image |
Original Image |
Arguments: -r 30 (default) |
Extracted Alpha Channel |
Profile Of Row 240 |
Profile Of Column 320 |
Example 2 -- Variation in Rolloff |
Original Image |
Arguments: -r 10 |
Arguments: -r 30 (default) |
Arguments: -r 50 |
Example 3 -- Composite of Two Images | ||
Image 1 (Foreground Image) |
Image 2 (Background Image) |
Composite Image |
What the script does is as follows:
This is equivalent to the following IM commands for the two image composite:
|