Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int div;
- void setup() {
- img = loadImage("http://media-cache-ak0.pinimg.com/736x/fb/01/f6/fb01f688101f5023e0745fce0d9651d1.jpg");
- size(img.width, img.height);
- int i=0;
- div=5;
- int stepx = (int) width/div;
- int stepy = (int) height/div;
- for (int x=0; x<width; x += stepx) {
- copy(img, x,0 , stepx, height, x, i*stepy, stepx, height);
- copy(img, x, height-i*stepy,stepx,i*stepy,x,0,stepx,i*stepy);
- i++;
- }
- }
- void draw() {
- }
- void keyPressed() {
- save(random(455)+".jpg");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement