Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- void setup() {
- size(500, 500);
- img = loadImage("data/coldplay.jpg");
- img.resize(500, 500);
- textSize(32);
- colorMode(HSB);
- }
- float t = 0;
- float dt = 1;
- void draw() {
- img.loadPixels();
- float div = 32.0;
- background(255);
- for (int x = 0; x < img.width; x++) {
- for (int y = 0; y < img.height; y++) {
- int idx = x + y * img.height;
- color col = img.pixels[idx];
- if (brightness(img.pixels[idx]) < 100) {
- point(x, y);
- }
- }
- }
- t += dt;
- }
Add Comment
Please, Sign In to add comment