Anonymous user
Percentage difference between images: Difference between revisions
→{{header|zkl}}: verbiage
(→{{header|Vedit macro language}}: added zkl) |
(→{{header|zkl}}: verbiage) |
||
Line 1,176:
throw(Exception.ValueError("width/height of the images must match!"));
Utils.Helpers.zipW(img1.data.howza(0),img2.data.howza(0)) // bytes, not strings
.reduce(fcn(totalDiff,[(a,b)]){ totalDiff
.toFloat()/img1.w/img1.h/3/255;
}</lang>
Take the bytes in each image, zip them together [lazily],
<lang zkl>fcn readJPG2PPM(fileName){
p:=System.popen("convert \"%s\" ppm:-".fmt(fileName),"r");
|