Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img1, img2;
- void setup() {
- img1 = loadImage("rousseau.jpg");
- img2 = loadImage("rousseau_bw.jpg");
- size(img1.width, img1.height);
- image(img1, 0, 0);
- img1.loadPixels();
- }
- void draw() {
- }
- void mouseClicked() {
- displayMask();
- }
- void drawLines() {
- for (int i=0; i<5; i++) {
- int y = int(random(600,850));
- int h = int(random(8,20));
- int x = int(random(-10,10));
- copy(img1, 0, y, width, h, x, y, width+x, h);
- }
- }
- void keyPressed() {
- save(random(1234)+".png");
- }
- void displayMask() {
- PGraphics mask = createGraphics(width, height);
- mask.beginDraw();
- mask.background(0);
- for (int i = 0; i < 80; i++) {
- mask.stroke(255, 60);
- mask.strokeWeight(random(15));
- mask.line(0, random(550,900)+random(-20, 20), width, random(550, 900)+random(-20, 20));
- }
- mask.endDraw();
- blend(mask, 0, 0, width, height, 0, 0, width, height, LIGHTEST);
- //image(mask, 0, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement