Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- float theta;
- int frames=80;
- void setup() {
- img=loadImage("jolie.jpg");
- size(img.width, img.height);
- }
- void draw() {
- image(img, 0, 0);
- float v = map(sin(theta), -1, 1, 0, 10);
- for (int x=0; x<width; x++) {
- for (int y=0; y<height; y++) {
- if (brightness(img.get(x, y))>40) {
- color c = img.get(x, y);
- for (int i=0; i<v; i++) {
- set(x-i*5, y, c);
- }
- }
- }
- }
- theta += TWO_PI/frames;
- //if (frameCount<=frames) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement