Guest User

Untitled

a guest
Jun 3rd, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. PImage img;
  2.  
  3. void setup() {
  4. size(500, 500);
  5. img = loadImage("data/coldplay.jpg");
  6. img.resize(500, 500);
  7. textSize(32);
  8. colorMode(HSB);
  9. }
  10.  
  11. float t = 0;
  12. float dt = 1;
  13.  
  14. void draw() {
  15. img.loadPixels();
  16. float div = 32.0;
  17. background(255);
  18. for (int x = 0; x < img.width; x++) {
  19. for (int y = 0; y < img.height; y++) {
  20. int idx = x + y * img.height;
  21. color col = img.pixels[idx];
  22. if (brightness(img.pixels[idx]) < 100) {
  23. point(x, y);
  24. }
  25. }
  26. }
  27. t += dt;
  28. }
Add Comment
Please, Sign In to add comment