## KALEIDOSCOPIC

 Applies a kaleidoscope effect to an image.

### EXAMPLES

 Original Arguments: -m image -o 0 Arguments: -m image -o 90 Arguments: -m image -o 180 Arguments: -m image -o 270 Arguments: -m image -o 0 -i Arguments: -m image -o 90 -i Arguments: -m image -o 180 -i Arguments: -m image -o 270 -i Arguments: -m disperse -o 0 -s 5 -d 5 -c 10 -n 1 Arguments: -m disperse -o 90 -s 5 -d 5 -c 10 -n 1 Arguments: -m disperse -o 180 -s 5 -d 5 -c 10 -n 1 Arguments: -m disperse -o 270 -s 5 -d 5 -c 10 -n 1 Arguments: -m disperse -o 0 -s 5 -d 5 -c 10 -n 1 -i Arguments: -m disperse -o 90 -s 5 -d 5 -c 10 -n 1 -i Arguments: -m disperse -o 180 -s 5 -d 5 -c 10 -n 1 -i Arguments: -m disperse -o 270 -s 5 -d 5 -c 10 -n 1 -i Arguments: -m random -o 0 -b 5 -e 2 -n 1 -i Arguments: -m random -o 90 -b 5 -e 2 -n 1 -i Arguments: -m random -o 180 -b 5 -e 2 -n 1 -i Arguments: -m random -o 270 -b 5 -e 2 -n 1 -i Arguments: -m random -o 0 -b 5 -e 2 -n 1 -B 100 Arguments: -m random -o 0 -b 5 -e 2 -n 1 -B 90 Arguments: -m random -o 0 -b 5 -e 2 -n 1 -B 80 Arguments: -m random -o 0 -b 5 -e 2 -n 1 -B 50

 Animation Original for ((i=1; i<=10; i=i+1)); do echo >&2 i=\$i kaleidoscopic -d 128 -n \$i pam: done | convert \ -delay 20 - \ \( -delay 20 -clone -1-1 \) \ -loop 0 \ kaleidoscopic_animation.gif

 What the script does is as follows for mode=image: Crops the image at the center to make it square, if needed Transposes the image Creates a diagonal black/white mask Composites the image and transpose using the mask Rotates the result 0, 90, 180 or 270 degrees as desired Creates a horizontal mirrored version and appends the two horizontally Creates a vertical mirrored version of the above result and appends the two vertically to form the output This is equivalent to the following IM commands ww=`convert \$infile -ping -format "%w" info:` hh=`convert \$infile -ping -format "%h" info:` min=`convert xc: -format "%[fx:min(\$ww,\$hh)]" info:` if [ \$ww -ne \$hh ]; then cropping="-gravity center -crop \${min}x\${min}+0+0" else cropping="" fi convert -quiet -regard-warnings "\$infile" \$cropping +repage "\$tmpA1" case "\$orient" in 270) rotation="-rotate 270";; 180) rotation="-rotate 180";; 90) rotation="-rotate 90";; 0) rotation="";; *) echo "--- ORIENT=\$orient IS AN INVALID VALUE ---" esac if [ "\$invert" = "yes" ]; then color1="black" color2="white" else color1="white" color2="black" fi convert \$tmpA1 \ \( +clone -transpose \) \ \( +clone -sparse-color voronoi "%w,0 \$color1 0, %h \$color2" \) \ -composite \$rotation \ \( +clone -flop \) +append \ \( +clone -flip \) -append \ \$outfile