Fred's ImageMagick Scripts
My scripts are available free of charge for non-commercial use. If you redistribute or incorporate any of these scripts into other free applications, you may use my scripts by simply referencing my name and this web page: Fred Weinhaus and http://www.fmwconcepts.com/imagemagick/index.html For use of my scripts in commercial use or non-free applications, please contact me for
licensing arrangements. Usage, whether stated in script or not, is also subject to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php |
|
Applies a stained glass cell effect to an image. |
last modified: May 06, 2012
|
USAGE: stainedglass [-k kind] [-s size] [-o offset] [-n ncolors] [-b bright] [-e ecolor] [-t thick] [-r rseed] infile outfile
-k .... kind ....... kind of stainedglass cell shape; choices are: square PURPOSE: Applies a stained glass cell effect to an image. DESCRIPTION: STAINEDGLASS applies a stained glass cell effect to an image. The choices of cell shapes are hexagon, square and randomized square. The cell size and border around the cell can be specified. ARGUMENTS: -k kind ... KIND of stainedglass cell shape; choices are: square (or s), hexagon (or h), random (or r). The latter is a square with each corner randomly offset. The default=random. -s size ... SIZE of stained glass cells. Values are integers>=0. The default=16. -o offset ... OFFSET is the random offset amount for the case of kind=random. Values are integers>=0. The default=6. -n ncolors ... NCOLORS is the number of desired reduced colors in the output. Values are integers>0. The default is no color reduction. Larger number of colors takes more time to color reduce. -b bright ... BRIGHTNESS value in percent for the output image. Values are integers>=0. The default=100 means no change in brightness. -e ecolor ... ECOLOR is the color for the edge or border around each cell. Any valid IM color is allowed. The default=black. -t thick ... THICK is the thickness for the edge or border around each cell. Values are integers>=0. The default=1. A value of zero means no edge or border will be included. -r rseed ... RSEED is the random number seed value for kind=random. Values are integers>=0. If a seed is provided, then the resulting image will be reproducable. The default is no seed. In that case, each resulting image will be randomly different. Thanks to Anthony Thyssen for critiqing the original version and for several useful suggestions for improvement. NOTE: This script will be slow due to the need to extract color values for each cell center point across the input image. A progress meter is therefore provided to the terminal. A speed-up is available via a -process function, getColors. To obtain getColors, contact me. It requires IM 6.6.2-10 or higher. 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: -k random -b 150 -t 1 -r 56 |
|
|
|
|
Arguments: -k hexagon -b 150 -t 1 |
|
|
|
|
Arguments: -k square -b 150 -t 1 |
|
|
|
|
Arguments: -k random -b 150 -t 0 -r 56 |
|
|
|
|
Arguments: -k hexagon -b 150 -t 0 |
|
|
|
|
Arguments: -k square -b 150 -t 0 |
|
|
What the script does is as follows:
This is equivalent to the following IM commands for kind=hexagon when no border is used.
|