PImage b, c; int x,y,n,w; int win_width; int win_height; int y_corner; void setup() { size(screen.width, screen.height);//, 800); //size(1200, 900); //b=loadImage("01_06_western landscape.jpg"); //b=loadImage("/home/robert/Desktop/Photos/03_washington dc bedroom 2.jpg"); b=loadImage("C:\\Swap\\Photos\\03_washington dc bedroom 2.jpg"); win_height=int(b.height*0.9); win_width=int(b.width*0.9);//win_height/height*width); y_corner=int((b.height-win_height)/2); //noLoop(); x=0; y=0; w=0; n=0; frameRate(24); } void auto_contrast(PImage in) { // adjust contrast in place on input image in.loadPixels(); // loop over pixels to find min and max Intensity // loop over pixels to scale RGB to min and max Intensity int dimension = (in.width*in.height); for(int i=0;i> 16) & 0xFF; // Faster way of getting red(argb) int g = (rgb >> 8) & 0xFF; // Faster way of getting green(argb) int b = rgb & 0xFF; // Faster way of getting blue(argb) r=int(r*0.5); g=int(g*0.5); b=int(b*0.5); in.pixels[i]=r+g+b; }; in.updatePixels(); }; void draw() { c = b.get(x, y+y_corner, win_width, win_height); auto_contrast(c); blend(c, 0, 0, win_width, win_height, 0, 0, width, height, BLEND); //blend(b, x, y+y_corner, (win_width), (win_height), 0, 0, width, height, BLEND); //filter(ERODE); //saveFrame("/Volumes/Swimming Pool/Processing/west-#####.tif"); //println(x+":"+b.width+" "+y+":"+b.height); // update motion n++; x+=int(random(0, 5)); y=int(random(0,10)); w=int(random(-5,0)); }