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. |
Randomly distributes clip art over the image. |
last modified: January 16, 2022
USAGE: randomclipart [-d dims] [-p percent] [-c color] [-a angles] [-o opacities]
infile clipartfiles outfile
-d ... dims ...... DIMS is the range of square dimensions of clip art; comma PURPOSE: To randomly distribute clip art over the image. DESCRIPTION: RANDOMCLIPART randomly distributes clip art over the image. The clip art can have randomized sizes, angles and colors and can be more or less frequently distributed over the image. There is no restriction on the dimensions of the clipartfile, since it will be scaled to have a maximum dimension defined by the dims arguments. The randomization process ensures that no copy of the clip art image will overlap. ARGUMENTS: -d dims ... DIMS is the range of scaled values for the maximum dimension of the clip art image. Values are expressed as a comma separate pair (larger first) of values in range of 0<integer<min image dimension. The default="64,16". Best to keep dims much smaller than the minimum input image dimension. If both values are the same or only one value is specified without a comma. The dimension will be a fixed amount. Note that the image will be trimmed on the left and bottom if not a whole multiple of the larger dims argument. -p percent ... PERCENTAGE distribution of the clip art coverage across the image. Values are 0<=integer<=100. The default=50. -c color ... COLOR of clip art. Any valid Imagemagick opaque color is allowed or random or image; use image to indicate that the clip art file is a transparent image and not to be colored. The default=random. -a angles ... ANGLES is the range of rotation angles of the clip art. Values are expressed as a comma separate pair of values (larger first) in the range of -360<=integer<=360. The default="45,-45". If both values are the same or onlyone value is specified without a comma, the rotation will be a fixed amount. Values are specified as "max-angle,min-angle" -o opacities ... OPACITIES is the range of opacities for the clip art, but only for random colors. Values are comma separate pair of integers in the range of 0<=integer<=100. The default="25,100". If both values are the same or only one value is specified without a comma, the opacity will be a fixed amount. Values are specified as "min-opacity,max-opacity". The clipartfiles should be either all white on black images to be colored or all transparent images, such as an emojis. There is no restriction on the dimensions of the clipartfile, since it will be scaled to have a maximum dimension defined by the dims arguments. NOTE: If the bash random value utility, jot, is available the script will run about 30% faster than getting random values using Imagemagick. 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: |
![]() |
Clip Art: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Clip Art: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Clip Art: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Clip Art: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Clip Art: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Clip Art: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Clip Art: |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Clip Art: |
![]() |
![]() |
![]() |
Arguments: |
![]() |
Original: |
![]() |
Clip Art: |
![]() |
![]() |
![]() |
![]() |
Arguments: |
![]() |
What the script does is as follows:
This is equivalent to the following IM commands for randomly colored clipart
|