// Displaying int weight=0; float sampleA,sampleB; float shade; int Continuum=0; int range=200; BImage imageA,imageB; // Declare variable "a" of type BImage void setup(){ size(400, 400); imageA = loadImage("jfk2.jpg"); // Load the images into the program imageB = loadImage("lincoln2.jpg"); // Load the images into the program //image(a,0,0,400,400); noStroke(); } void loop(){ Continuum++; weight=abs(Continuum%(2*range)-(2*(Continuum%range))); ///linear ocilations between 0 and range //println(weight); for (int count=0;count<1600;count++) { fill (255); rect ((count%40)*10,int(count/40)*10,10,10); sampleA=red(imageA.pixels[count]); ///could be any channel. sampleB=red(imageB.pixels[count]); shade=(sampleB*(range-weight)+sampleA*weight)/(2.55*range); if (shade>50){ shade=ceil(sqrt(shade)); fill (255); rect ((count%40)*10,int(count/40)*10,10,10); fill (0); rect ((count%40)*10,int(count/40)*10,10-shade,10-shade); }else { shade=10-ceil(sqrt(shade)); fill (0); rect ((count%40)*10,int(count/40)*10,10,10); fill (255); rect ((count%40)*10,int(count/40)*10,10-shade,10-shade); } } }