nr = 384 / 2;
nc = 384 / 2;
bitmap = J( nr, nc, -Random Integer( 0, 255 * 255 * 255 ) );
New Window( "x", bb = Border Box( Text Box( "x" ) ) );
nn = 1e6;
//pngdir = "F:/raindrops/png1/";
//Create Directory( pngdir );
While( nn-- > 0,
For( i = 1, i <= 1, i += 1,
img = New Image( bitmap );
img << setsize( {nc - 2, nr - 2} ); // use JMP's image processing to shrink array to the center
x = (img << getpixels)[0, 0]; // then put the shrunken image back
bitmap[2 :: nr - 1, 2 :: nc - 1] = x[1 :: nr - 2, 1 :: nc - 2]; // the add fresh noise around the edge
bitmap[1, 0] = J( 1, nc, -Random Integer( 0, 255 * 255 * 255 ) );
bitmap[nr, 0] = J( 1, nc, -Random Integer( 0, 255 * 255 * 255 ) );
bitmap[0, 1] = J( nr, 1, -Random Integer( 0, 255 * 255 * 255 ) );
bitmap[0, nc] = J( nr, 1, -Random Integer( 0, 255 * 255 * 255 ) );
);
img << setsize( {1920 * 1, 1920 * 1} ); // stretch, a lot
img << filter(
"canny", // use the canny edge detector
largeThreshold( .001 )/*tracing begins when a large-value edge is found*/,
smallThreshold( .00001 )/*tracing stops when the edge value gets too small*/,
radius( 3 )/*a blur-filter, use 0 for no blurring*/,
Repeat( 3 )/* number of repeats of a box-blur; 3 approximates a gaussian-blur filter */
);
// img << saveimage( pngdir || Char( nn ) || ".png" );
If( Mod( nn, 1 ) == 0,
imgS = New Image( img );
imgS << scale( .9 ); // keep it on screen by shrinking a bit
(bb << child) << delete; // remove old content
bb << append( imgS ); // add new content
);
Wait( .1 );
);