SHARE
TWEET

Untitled

a guest Jun 3rd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top