Fred's ImageMagick Scripts



    Licensing:

    Copyright © Fred Weinhaus

    My scripts are available free of charge for non-commercial 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

MANDALA


Creates a Mandala type image from simple graphic figures.

Download Script

last modified: December 01, 2017



USAGE: mandala [-d dimension] [-t type] [-l length] [-n number] [-w width] [-s spiral] [-r revolutions] [-o offset] [-C colors] [-b bgcolor] outfile
USAGE: mandala [-help]

-d ... dimensions .... dimensions of square output image; integer>0; default=500
-t ... type .......... type of graphic figure; line, square, triangle, diamond or
...................... circle; default=line
-l ... length ........ length of line or side or polygon or radius of circle;
...................... integer>0; default=150
-n ... number ........ number of repeats of graphic figure; integer>0; default=16
-w ... width ......... stroke width use to draw graphic figure; integer>0; default=1
-s ... spiral ........ spiral the distance from the center outward; yes or no;
...................... default=no (constant distance)
-r ... revolutions ... number of revolutions covering all the number of repeats;
...................... integer>0; default=1
-o ... offset ........ offset of figure from the center of the image; integer>=0;
...................... default=0
-C ... colors ........ list of space delimited colors for the graphic figure; any
...................... valid Imagemagick color is allowed; list must include at least
...................... one color; default="red green1 blue"
-b ... bgcolor ....... background color for the output image; any valid Imagemagick
...................... color is allowed; default=white

PURPOSE: To create a Mandala type image from simple graphic figures.

DESCRIPTION: MANDALA creates a Mandala type image from simple graphic figures. The choice of graphic includes: line, triangle, square, diamond and circle.

ARGUMENTS:

-d dimension ... DIMENSION of square output image. Values are integers>0. The default=500.

-t type ... TYPE (shape) of graphic figure. The choices are: line (l), square (s), triangle (t), diamond (d) or circle (c). The default=line.

-l length ... LENGTH of line or side of triangle/square/diamond or radius of circle. Values are integers>0. The default=150.

-n number ... NUMBER of repeats of the graphic figure. Values are integers>0. The default=16. Maximum value is OS dependent on the maximum allowed string length and arguments used. On my Mac is seems to peak at about 2000.

-w width ... WIDTH is the stroke width use to draw graphic figure. Values are integers>0. The default=1.

-s spiral ... SPIRAL the distance of the figure from the center outward. The choices are: yes (y) or no (n). The default=no (constant distance).

-r revolutions ... REVOLUTIONS is the number of revolutions covering all the number of repeats. Values are integers>0. The default=1.

-o offset ... OFFSET of figure from the center of the image. Values are integers>=0. The default=0.

-C colors ... COLORS is a list of space delimited colors for the graphic figure. Any valid Imagemagick color is allowed. The list must include at least one color. The default="red green1 blue".

-b bgcolor ... BGCOLOR is the background color for the output image. Any valid Imagemagick color is allowed. The default=white.

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


Example 1 - Line

Arguments:
-t line -n 8 -w 1 -c "red green blue"
Arguments:
-t line -n 8 -w 4 -c "red green blue"
Arguments:
-t line -n 16 -w 1 -c "red green blue"
Arguments:
-t line -n 32 -w 1 -c "red green blue"


Example 2 - Triangle

Arguments:
-t triangle -n 3 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 12 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 48 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 192 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 384 -w 1 -c "black"
Arguments:
-t triangle -n 1500 -w 1 -s yes -r 75 -o 20 -c "black"
Arguments:
-t triangle -n 1080 -w 1 -s yes -r 5 -o 20 -c "red green1 blue"


Example 3 - Square

Arguments:
-t square -n 3 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 12 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 48 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 384 -w 1 -c "black"
Arguments:
-t triangle -n 1080 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 2200 -w 1 -s yes -r 10 -c "red green1 blue"


Example 4 - Diamond

Arguments:
-t diamond -n 3 -w 1 -c "red green1 blue"
Arguments:
-t diamond -n 12 -w 1 -c "red green1 blue"
Arguments:
-t diamond -n 48 -w 1 -c "red green1 blue"
Arguments:
-t diamond -n 384 -w 1 -c "black"
Arguments:
-t diamond -n 384 -w 1 -c "red green1 blue"
Arguments:
-t diamond -n 1080 -w 1 -c "red green1 blue"
Arguments:
-t triangle -n 2000 -w 1 -s yes -r 5 -c "red green1 blue"


Example 5 - Circle

Arguments:
-t circle -n 3 -w 1 -c "red green1 blue"
Arguments:
-t circle -n 12 -w 1 -c "red green1 blue"
Arguments:
-t circle -n 48 -w 1 -c "red green1 blue"
Arguments:
-t circle -n 384 -w 1 -c "red green1 blue"
Arguments:
-t circle -n 1080 -w 1 -s yes -r 5 -o 20 -c "red green1 blue"
Arguments:
-t circle -n 2000 -w 1 -s yes -r 5 -c "red green1 blue"


What the script does is as follows:

  • Repeatedly draws the specified line or polygon or circle on
    the image rotating it in increments determined by the specified
    number of repeats and the number of revolutions