Processing Forum
loadPixels();
cam.loadPixels();
photo.loadPixels();
diff.loadPixels();
for(int i =0; i<cam.pixels.length; i++){
diffR = abs(red(cam.pixels[i]) - red(photo.pixels[i]));
diffG = abs(green(cam.pixels[i]) - green(photo.pixels[i]));
diffB = abs(blue(cam.pixels[i]) - blue(photo.pixels[i]));
diff.pixels[i] = color(diffR, diffG, diffB);
}
cam.updatePixels();
photo.updatePixels();
diff.updatePixels();
image(cam,0,0);
image(photo,0,0);
image(diff,200,300);