Random Ovals

Author: Wayne Rasband (wsr at nih.gov)
History: 2002/03/06: First version
Source: Random_Ovals.java
Installation: Download Random_Ovals.class to the plugins folder and restart ImageJ.
Description: This plugin opens a window and draws ovals in random sizes and colors.

Here is a macro version (requires ImageJ 1.29f or later):

	
  run("New...", "name=Untitled type='32-bit RGB' width=400 height=400");
  width = getWidth();
  height = getHeight();
  for (i=0; i<500; i++) {
      w = random()*width/2+1;
      h = random()*width/2+1;
      x = random()*width-w/2;
      y = random()*height-h/2;
      setForegroundColor(random()*255, random()*255, random()*255);
      makeOval(x, y, w, h);
      run("Fill");
   }
   

|Plugins | Home |