Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- void setup() {
- size(540, 540);
- colorMode(HSB);
- //img = loadImage("https://s-media-cache-ak0.pinimg.com/474x/31/45/56/31455645924b80eb861fb9f55b7dfa1d.jpg");
- img = loadImage("pic.JPG");
- img.filter(GRAY);
- image(img, 0, 0, width, height);
- }
- void draw() {
- blurNoise();
- if (frameCount%4==0 && frameCount<=280) saveFrame("/Volumes/Anim/image-###.gif");
- //println(frameCount);
- }
- void blurNoise() {
- filter(BLUR, 0.6);
- loadPixels();
- for (int i = 0; i<pixels.length; i++) {
- float b = brightness(pixels[i]);
- float newB = b+noise(i*0.01, frameCount*0.03)*10;
- float s = saturation(pixels[i]);
- float h = hue(pixels[i]);
- if (b > 150) {
- pixels[i] = color(h, s, newB);
- }
- }
- updatePixels();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement