Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int edge;
- void setup() {
- size(540, 540);
- img = loadImage("pic1.jpg");
- edge = width/5;
- rectMode(CENTER);
- }
- void draw() {
- background(20);
- noStroke();
- for (int x=edge; x<width-edge; x++) {
- int y = frameCount%height;
- float br = brightness(img.get(x, y));
- float h = map(br, 0, 255, 0, height/2);
- fill(br);
- rect(x, height/2, 1, h);
- }
- //if (frameCount%2==0 && frameCount<500) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement