Advertisement
xeromino

photoManip

Nov 10th, 2013
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. PImage img1, img2;
  2.  
  3. void setup() {
  4.   img1 = loadImage("rousseau.jpg");
  5.   img2 = loadImage("rousseau_bw.jpg");
  6.   size(img1.width, img1.height);
  7.   image(img1, 0, 0);
  8.   img1.loadPixels();
  9. }
  10.  
  11.  
  12. void draw() {
  13. }
  14.  
  15.  
  16. void mouseClicked() {
  17.   displayMask();
  18. }
  19.  
  20. void drawLines() {
  21.   for (int i=0; i<5; i++) {
  22.     int y = int(random(600,850));
  23.     int h = int(random(8,20));
  24.     int x = int(random(-10,10));
  25.     copy(img1, 0, y, width, h, x, y, width+x, h);
  26.   }
  27. }
  28.  
  29. void keyPressed() {
  30.   save(random(1234)+".png");
  31. }
  32.  
  33. void displayMask() {
  34.   PGraphics mask = createGraphics(width, height);
  35.   mask.beginDraw();
  36.   mask.background(0);
  37.   for (int i = 0; i < 80; i++) {
  38.     mask.stroke(255, 60);
  39.     mask.strokeWeight(random(15));
  40.     mask.line(0, random(550,900)+random(-20, 20), width, random(550, 900)+random(-20, 20));  
  41.   }
  42.   mask.endDraw();
  43.   blend(mask, 0, 0, width, height, 0, 0, width, height, LIGHTEST);
  44.   //image(mask, 0, 0);
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement