BImage image; void setup() { // smooth(); image = loadImage("balloons.jpg"); size(image.width, image.height); framerate(20); } void loop() { background(image); int count = 8; int mx = constrain(mouseX,15,width-15); int my = constrain(mouseY,15,height-15); for (int i=count; i>=0; i--) { int sx = 30+i*5; int sy = 30+i*5; int dx = 30+((width/2-15)*i/count); int dy = 30+((height/2-15)*i/count); int ix = width/2*i/count + (mx*(count-i)/count); int iy = height/2*i/count + (my*(count-i)/count); image(image.get(mx-sx,my-sy,sx*2,sy*2), ix-dx, iy-dy, dx*2,dy*2); } }