Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. PImage img;
  2. int smallPoint, largePoint;
  3.  
  4. void setup() {
  5. size(360,640);
  6. // size (1275,2267);
  7.  
  8. img = loadImage("naranja.png");
  9. img.resize(360, 640);
  10. // img.resize(1275,2267);
  11.  
  12.  
  13. smallPoint = 10;
  14. largePoint = 50;
  15. imageMode(CENTER);
  16. noStroke();
  17. background(255);
  18. frameRate (50);
  19.  
  20. }
  21.  
  22. void draw() {
  23. float pointillize = map(mouseX, 0, width, smallPoint, largePoint);
  24. int x = int(random(img.width));
  25. int y = int(random(img.height));
  26. color pix = img.get(mouseX, mouseY);
  27. fill(pix, 128);
  28. rect(mouseX,mouseY, pointillize, pointillize);
  29.  
  30. }
  31.  
  32.  
  33.  
  34. void mousePressed() {
  35. saveFrame ("rs-###.jpg");
  36. }
  37.  
  38. void keyPressed() {
  39. setup();
  40. redraw();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement