Februar 28, 2012
Lass eine Bilderserie als Animation abspielen (Array). SourcecodePImage[] imageList = null; int listLenght = 127; int i=0; void setup() { size(300, 230); noStroke(); PImage tmpImage; color col; int r,g,b,a; //init imageList = new PImage[listLenght]; for(int i=0; i < listLenght; i++) { tmpImage = loadImage("./retina/image"+i+".jpg"); tmpImage.loadPixels(); imageList[i] = createImage(tmpImage.width, tmpImage.height, ARGB); imageList[i].loadPixels(); for(int j=0; j<tmpImage.width*tmpImage.height; j++) { col = tmpImage.pixels[j]; r = red(col); g = green(col); b = blue(col); // filter calculations a = (r+g+b)/3; col = color(r,0,0,a); imageList[i].pixels[j] = col; } imageList[i].updatePixels(); } } void draw() { background(255); if(i>=listLenght) { i=0; } imageList[i].resize(300,230); image(imageList[i],0,0); i++; }