basic bitmap storage
Useful for comparing two JPEG images saved with a different compression ratios.

You can use these pictures for testing (use the full-size version of each):



50% quality JPEG

100% quality JPEG







link to full size 50% image

link to full size 100% image

The expected difference for these two images is 1.62125%

fcn imageDiff(img1,img2){
   if(img1.w!=img2.w or img1.h!=img2.h)
      throw(Exception.ValueError("width/height of the images must match!"));
   img1.data.howza(0).walker().zip(img2.data.howza(0)) // lazy bytes, not strings
   .reduce(fcn(totalDiff,[(a,b)]){ totalDiff + (a - b).abs() },0)
   .toFloat()/img1.w/img1.h/3/255; // or: .toFloat()/img1.data.len()/255
}