Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int f, step = 4;
- void setup() {
- img = loadImage("tmp-0.gif");
- size(img.width, img.height);
- background(0);
- stroke(255);
- colorMode(HSB, 255, 100, 100);
- rectMode(CENTER);
- frameRate(10);
- }
- void draw() {
- if (frameCount==172) noLoop();
- convPic();
- }
- void convPic() {
- background(#000000);
- img = loadImage("tmp-"+((frameCount-1)%172)+".gif");
- for (int x=2; x<width; x += step) {
- for (int y=2; y<height; y+= step) {
- f = (int) map(y, 0, height, 0, 255);
- color col = img.get(x, y);
- if (brightness(col)<80) {
- fill(f, 100, 100);
- } else {
- fill(#2F065A);
- }
- stroke(#000000);
- rect(x, y, step, step);
- }
- }
- saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement