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. |
Rotates each successive square-sized patch in the image. |
last modified: December 15, 2018
USAGE: dice [-s size] [-p percent] [-c center] [-r radii] [-R rounding]
[-n] [-e ecolor] infile [maskfile] outfile
-s ... size ....... size of square patches; integer>0; default=16 PURPOSE: To randomly rotate each successive square-sized patch in the image. DESCRIPTION: DICE rotates each successive non-overlapping square-sized patch in the image by a random choice of 0, 90, 180 and 270 degrees. An optional round rectangle mask may be defined to delineate where the dicing will be shown. Or an external mask image may be provided. ARGUMENTS: -s size ... SIZE of the square-sized patches to randomize; Values are integers>1. The default=16. -p percent ... PERCENT is the percentage of patches to randomly process. Values are 0<=integers<=100. The default=100 (all patches). -c center ... CENTER is the x and y center coordinates of the round rectangle mask with white on the inside and black on the outside; comma separate pair of integers>=0; default=center of image -r radii ... RADII are the x and y radii of a round rectangle mask expressed as a comma separated pair of integers>=0. The default="0,0" (no mask). -R rounding ... ROUNDING is the round rectangle corner radii expressed as a pair of comma separated values. Values are integers>=0. The default="0,0". -n negate ... NEGATE the mask (invert black and white). -e ecolor ... ECOLOR is the edge color of the mask boundary to show on the resulting image. Any valid opaque IM color is allowed. The default is not to show the edge boundary on the image. NOTE: The script runs slowly. A 256x256 sized image processed on my INTEL Mac Mini in about 15 sec for dimension 16 and about 3 sec for dimension 32. Thus larger sized patches will process faster. 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: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Mask: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Arguments: |
![]() |
Arguments: |
![]() |
What the script does is as follows:
This is equivalent to the following IM commands
|