img1.beginDraw();
img1.background(0);
x = width/nb * int (random(nb+1));
y = int (width/nb * int (random(nb+1)));
a = width/nb*2;
img1.ellipse(x,y,a,a);
img1.endDraw();
Another trouble is that it creates outlines around identical superimposed forms as positions and sizes are strictly the same between scrImg and the display window.