Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- void setup() {
- img = loadImage("https://s-media-cache-ak0.pinimg.com/736x/ad/3d/85/ad3d8563a5758db9fb79980cd4f9df40.jpg");
- size(img.width, img.height);
- noStroke();
- strokeWeight(2);
- background(255);
- for (int i=0; i<150000; i++) {
- float x = random(width);
- float y = random(height);
- color c = img.get(int(x), int(y));
- if (brightness(c)<=100) {
- stroke(0, 60);
- pushMatrix();
- translate(x, y);
- rotate(random(PI));
- line(-5, 0, 5, 0);
- popMatrix();
- }
- if (brightness(c)>100 && brightness(c)<150) {
- if (random(1)>.3) {
- stroke(0, 25);
- pushMatrix();
- translate(x, y);
- rotate(random(PI));
- line(-5, 0, 5, 0);
- popMatrix();
- }
- }
- }
- }
- void draw() {
- }
- void keyPressed(){
- save(random(3434)+".jpg");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement