xxxxxxxxxx
PImage bg;
color c;
float i = 1;
void setup() {
frameRate(500);
size(1200, 1800, P2D);
bg = loadImage("glitch.png");
bg.resize(width, height);
image(bg, 0, 0);
background(0);
}
int count = 0;
void draw() {
for (int x = 0; x < bg.width; x+=20) {
for (int y = 0; y < bg.height; y+=20) {
c = bg.get(x, y);
float b = brightness(c);
b = map(b, 0, 255, 15, 5);
smooth();
fill(c);
noStroke();
pushMatrix();
translate(i, i);
rect(x, y, b*0.2, b*1.5);
popMatrix();
i++;
if (i > 60) i = 0;
}
}
}