Copyright © Fred Weinhaus My scripts are available free of charge for noncommercial use, ONLY. For use of my scripts in commercial (forprofit) environments or nonfree 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 forprofit 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 
Creates an image composed of a moderate sized black random blob shape on a white background. 
last modified: September 26, 2017
USAGE: randomblob [n numpts] [l linewidth] [i isize] [o osize]
n ... numpts ....... number of random points; integer>0; default=12; PURPOSE: To create an image composed of a moderate sized black random blob shape on a white background. DESCRIPTION: RANDOMBLOB creates an image composed of a moderate sized black random blob shape on a white background from a set of uniformly or Gaussian distributed random points. The points are connected by either thick straight lines or thick spline curves, then Gaussian blurred and thresholded to a binary image. ARGUMENTS: l linewidth ... LINEWIDTH is the width of lines or spline drawn between points. Values are integers greater than zero. The default=13. i isize ... ISIZE is the pixel size for the inner region where the black blob will be contained. One value is to be provided which will be the width=height=diameter depending upon the shape (square or disk). This parameter is ignored when mask is provided. Values are integers greater than zero. The default=400. o osize ... OSIZE is the pixel size of the outer region, i.e. the output image. One or two values may be provided as widthxheight. If only one value is provided, then it is used for both width and height. Values are integers greater than zero. The default=512. s shape ... SHAPE is the shape of inner region. Choices are either square [s] or (circular) disk [d]. This parameter is ignored when a mask image is provided. The default=disk. b blur ... BLUR is the value for the gaussian blur sigma. The nominal value is about isize/12. Values are floats greater than zero. The default=33. t threshold ... THRESHOLD is the percent threshold applied to gaussian blurring. Values are integers greater than zero and less than 100. The default=25. k kind ... KIND is the kind of random point distribution. Choices are either uniform [u] or gaussian [g]. The default=uniform. g gsigma ... GSIGMA is the gaussian distribution sigma value. The nominal value is about isize/6. Values are floats greater than zero. The default=67. c constrain ... CONSTRAIN the gaussian distribution to the inner region. Choices are yes [y] or no [n]. The default=yes. d drawtype ... DRAWTYPE is the method to connect the random points. The choices are either (straight) line [l] or (KB) spline [s]. The default=spline. T tension ... TENSION is the tension parameter for the spline. Values are floats. Negative values are permitted. The default=0. C continuity ... CONTINUITY is the continuity parameter for the spline. Values are floats. Negative values are permitted. The default=0. B bias ... BIAS is the bias parameter for the spline. Values are floats. Negative values are permitted. The default=0. S seed ... SEED for random number generator or if F file2 parameter is used, it is the index into the file to access the first desired point pair to use and the n numpts parameter will identify the successive number of point pairs to extract from the file. Values are integers greater than zero. Ignored if argument f file1 is present. The default=1. p pixinc ... PIXINC is the increment or separation in pixels for the spline interpolated points. Larger values will produce faster results, but too large a value may lead long straight sections. Values are integers greater than zero. The default=2. f file1 ... file1 is a simple text file containing comma separate pairs of random numbers in the range [0,1) with one pair per line. If provided, it then avoids internal computation of random numbers. The default is no text file. F file2 ... file2 is a simple text file containing the desired number or more comma separated pairs of random numbers in range [0,1) with one pair per line. If provided, then the S seed parameter is used as and index into the file to locate the first point pair to use and n numpts parameter will be used as the number of successive point pairs to extract. The Default is no point file. A file with 10,000 random point pairs computed from the number pi is available as pipoints.csv from: http://www.vips.ecs.soton.ac.uk/index.php?title=Random_Generation_of_Mildly_Irregular_Shapes_for_Cognitive_Experiments Note: When using the Gaussian distribution, the results will be the same whether the shape of the inner region is square or disk, unless the points exceed the inner region and the constrain parameter is on. Note: When using a circular mask, the results for a uniform distribution of points will be different from using shape=disk with no mask, because different algorithms are used for limiting the points to either disk region. A square mask will produce the same results as using shape=square for the uniform distribution of points.
This script is based upon the following paper: Nicolas Robidoux Dept of Mathematics and Computer Science Laurentian University Sudbury, ON Canada nicolas.robidoux@gmail.com
References for the KochaneckBartels Spline are: 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. 
Variation In Seed 

Uniform Distribution On Square: Seed=1 
Uniform Distribution On Square: Seed=1003 
Uniform Distribution On Disk: Seed=1 
Uniform Distribution On Disk: Seed=1003 
Gaussian Distribution On Square: Seed=1 
Gaussian Distribution On Square: Seed=1003 
Gaussian Distribution On Disk: Seed=1 
Gaussian Distribution On Disk: Seed=1003 
Variation In Number Of Points 

Uniform Distribution On Square: 12 Points 
Uniform Distribution On Square: 16 Points 
Uniform Distribution On Disk: 12 Points 
Uniform Distribution On Disk: 16 Points 
Gaussian Distribution On Square: 12 Point 
Gaussian Distribution On Square: 16 Points 
Gaussian Distribution On Disk: 12 Points 
Gaussian Distribution On Disk: 16 Points 
What the script does is as follows:
