fmw42 wrote: ↑2017-12-01T16:09:29-07:00I just uploaded a new script, mandala, to create Mandala type image from simple graphic shapes. See my link below.
It looks like your link to the script hasn't updated yet, but the example figures look like the script can do some pretty cool stuff.
I've been fascinated by ImageMagick's power to do some wildly complex things within a single command, and I spent a lot of time working up a kaleidoscope script for IM7 and Windows. This command takes any image or even the system clipboard as input, makes a kaleidoscope of the given number of slices, and outputs the final design as a square the size of the height of the input image.
Code: Select all
set INIMAGE=input.jpg
set OUTFILE=kaleidoscope.png
set SLICES=12
magick ^
%INIMAGE% ^
-alpha set ^
-background none ^
-virtual-pixel mirror ^
-set option:distort:viewport %[fx:ceil(h*tan((180/%SLICES%)*pi/180))]x%[h] ^
-distort affine "%[fx:w/2],0 0,0" ^
-distort affine "0,0 %[w],0 0,%[h] 0,%[h] 1,%[h] 1,%[h]" ^
-virtual-pixel none ^
-distort affine "0,%[h] %[w],%[h] 0,0 0,0 1,0 1,0" ^
-virtual-pixel mirror ^
-set option:distort:viewport %[fx:w*2]x%[h] ^
-distort SRT 0 ^
-duplicate %[fx:%SLICES%-1] ^
-virtual-pixel none ^
-set option:distort:viewport %[h]x%[h] ^
-distort SRT "%[fx:w/2],%[h] 0.71 %[fx:t*360/n] %[fx:h/2],%[fx:h/2]" ^
+repage ^
-flatten ^
-alpha off ^
%OUTFILE%
This should work by setting the three variables and simply copying and pasting at the Windows command prompt. To put it in a Windows BAT script requires changing the single percent signs "%" to doubles "%%" everywhere
except the %INIMAGE%, %OUTFILE%, and %SLICES% variables.
To convert to a *nix script requires changing the continued line carets "^" to backslashes "\", and may need quoting or escaping some other characters. The way the variables are set and read would also need a tweak. I don't have IM7 on a *nix system to check it.
For my own use I generate a random number for the %SLICES% variable. I also "-normalize" just before the output to punch up the colors. The command above is pretty much just the engine that does the real work of calculating the angles, cutting the slices, and assembling them to create the ouput image.