Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int f, step = 5;
- void setup() {
- img = loadImage("tmp-0.gif");
- size(img.width, img.height);
- background(0);
- noStroke();
- }
- void draw() {
- convPic();
- if (frameCount==171) noLoop();
- }
- void convPic() {
- background(255);
- img = loadImage("tmp-"+(frameCount-1)+".gif");
- for (int x=0; x<width; x += step) {
- for (int y=0; y<height; y+= step) {
- color col = img.get(x, y);
- f= brightness(col)>150?255:0;
- fill(f);
- ellipse(x, y, step, step);
- }
- }
- saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement