Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.hamoid.*;
- VideoExport videoExport;
- PImage img;
- float nz;
- void setup() {
- size(500, 540);
- img = loadImage("photo2.jpg");
- videoExport = new VideoExport(this, "internetVideo.mp4");
- videoExport.setFrameRate(30);
- videoExport.startMovie();
- }
- void draw() {
- filterStuff();
- if (frameCount<600) videoExport.saveFrame();
- if (frameCount>=600) videoExport.endMovie();
- }
- void filterStuff() {
- image(img, 0, 0);
- colorMode(HSB);
- loadPixels();
- float nx = 0;
- float ny = 0;
- for (int x=0; x<width; x++) {
- ny = 0;
- for (int y=0; y<height; y++) {
- float ns = noise(nx, ny, nz);
- float h = hue(img.get(x, y));
- float s = saturation(img.get(x, y));
- float b = brightness(img.get(x, y));
- if (ns > 0.5) pixels[y*width+x] = color(h, 255-s, b);
- ny += 0.005;
- }
- nx += 0.005;
- }
- updatePixels();
- nz += 0.007;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement