Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int num = 30;
- float y, sz;
- void setup() {
- img = loadImage("photo.jpg");
- size(img.width, img.height);
- image(img, 0, 0);
- frameRate(15);
- sz=width/float(num);
- }
- void draw() {
- for (int i=0; i<num+1; i++) {
- float x = sz*i;
- color f = img.get(int(x), int(y));
- fill(f, 150);
- noStroke();
- rect(x, random(height), sz, sz*2);
- if (y>height) y=0;
- }
- y++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement