Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- void setup() {
- size(800, 800);
- img = loadImage("pic.jpg");
- PImage temp = createImage(400, 400, RGB);
- temp.loadPixels();
- for (int x=0; x<temp.width; x++) {
- for (int y=0; y<temp.height; y++) {
- color c = img.get(x, y);
- temp.set(x, y, c);
- }
- }
- image(temp, 0, 0);
- pushMatrix();
- translate(width, 0);
- scale(-1, 1);
- image(temp, 0, 0);
- popMatrix();
- pushMatrix();
- translate(0, height);
- scale(1, -1);
- image(temp, 0, 0);
- popMatrix();
- pushMatrix();
- translate(width, height);
- scale(-1, -1);
- image(temp, 0, 0);
- popMatrix();
- loadPixels();
- PImage stamp = createImage(width, height, RGB);
- stamp.loadPixels();
- for (int i=0; i<width*height; i++) {
- stamp.pixels[i]=pixels[i];
- }
- stamp.updatePixels();
- //tint(255,0,0);
- //image(stamp,0,0);
- int d = 400;
- for (int x=0; x<width; x+=d) {
- for (int y=0; y<height; y+=d) {
- copy(stamp, 0, 0, width, height, x, y, d, d);
- }
- }
- }
- void draw() {
- }
- void keyPressed() {
- save(random(12345)+".jpg");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement