Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- float x, y;
- void setup() {
- img = loadImage("http://media-cache-ak0.pinimg.com/736x/7e/db/9f/7edb9f5c166f9d53e3a7c05356f65177.jpg");
- size(img.width, img.height);
- noStroke();
- background(255);
- }
- void draw() {
- x = random(width);
- y = random(height);
- color col = img.get(int(x), int(y));
- pushMatrix();
- translate(x, y);
- rotate(random(PI));
- float sz1 = 50;
- float sz2 = 300;
- float sz = random(sz1, sz2);
- float alpha1 = map(sz, sz1, sz2, 50, 20);
- float alpha2 = map(brightness(col), 0, 255, 50, 0);
- float alpha = alpha1+alpha2;
- fill(col, alpha);
- rect(0, 0, sz, sz);
- popMatrix();
- }
- void keyPressed() {
- save(random(999999)+".jpg");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement