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/06/85/af/0685af6703ebb443176267bee9560237.jpg");
- img=loadImage("https://s-media-cache-ak0.pinimg.com/736x/67/60/ae/6760aedd002069850dd0e51524b30748.jpg");
- size(img.width, img.height);
- image(img, 0, 0);
- for (int i=0; i<2000; i++) {
- int x =(int) random(width);
- int y = (int) random(height);
- color c = img.get(x, y);
- if (brightness(c)>200) {
- stroke(255, 100);
- if (x<width*.7) {
- line(x, y, 0, random(height));
- } else {
- line(x, y, width, random(100,height-100));
- }
- }
- }
- for (int x=0; x<width; x++) {
- for (int y=0; y<height; y++) {
- if (brightness(img.get(x, y))>50) {
- //ellipse(x, y, 5, 5);
- color c = img.get(x,y);
- set(x,y,c);
- }
- }
- }
- }
- void draw() {
- }
- void keyPressed() {
- save(random(233)+".jpg");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement