String filename = "threedrops.jpg"; PImage image; void setup() { size(300, 360, P3D); image = loadImage(filename); noLoop(); } void draw() { background(0); image(image,(width-image.width)/2,(height-image.height)/2,image.width,image.height); // image(image,(width-image.width)/2,0,image.width,image.height); float t = random(5);//millis() / 1000.0; /* float r = random(255); float g = random(255); float b = random(255); for (float x = 0; x < width; x++) { for (float y = 0; y < height; y++) { float n = noise(10*x/width,10*y/height,t); set((int)x,(int)y,color(n*r,n*g,n*b)); } } */ noFill(); stroke(255); for (int i = 0; i < width; i+=18) { for (int j = 0; j < height; j+=18) { float d = dist(i+9,j+9,width/2,height/2) / dist(9,9,width/2,height/2); float n = noise(i,j,t); if (n < 1-d) { noFill(); } else { fill(255); } stroke(255); rect(i,j,18,18); } } for (int i = 0; i < width; i+=18) { for (int j = 0; j < height; j+=18) { float d = dist(i+9,j+9,width/2,height/2) / dist(9,9,width/2,height/2); float n = noise(i,j,t); if (n < (1-d)*0.8) { PImage section = get(i,j,18,18); for (int f = 0; f < 48; f++) { section.filter(BLUR, 1); } set(i,j,section); } } } for (int i = 0; i < width; i+=18) { for (int j = 0; j < height; j+=18) { float d = dist(i,j,width/2,height/2) / dist(0,0,width/2,height/2); float n = noise(i,j,t); if (n < 1-d) { noFill(); } else { fill(255); } stroke(255); rect(i,j,18,18); } } if (!online) save("blurry_"+frameCount+"_"+filename); } void mousePressed() { redraw(); }