Comparing version 0.8.0 to 0.8.2
13
index.js
@@ -1,2 +0,2 @@ | ||
// jshint esversion: 6, globalstrict: true, strict: true | ||
// jshint esversion: 6, globalstrict: true, strict: true, bitwise: false | ||
'use strict'; | ||
@@ -36,7 +36,7 @@ | ||
break; | ||
case 'luminosity' : | ||
case 'average' : | ||
this._grayscale = this._averageToGray; | ||
break; | ||
default ://luminosity | ||
this._grayscale = this._luminosityToGray; | ||
break; | ||
default : | ||
this._grayscale = this._averageToGray; | ||
} | ||
@@ -115,4 +115,3 @@ }; | ||
PamDiff.prototype._luminosityToGray = function (r, g, b) { | ||
//return 0.299 * r + 0.587 * g + 0.114 * b; | ||
return 0.3 * r + 0.59 * g + 0.11 * b; | ||
return ((66 * r + 129 * g + 25 * b + 128) >> 8) + 16; | ||
}; | ||
@@ -119,0 +118,0 @@ |
{ | ||
"name": "pam-diff", | ||
"version": "0.8.0", | ||
"version": "0.8.2", | ||
"description": "Measure differences between pixel arrays extracted from pam images", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
18406
309