From 81f41cb9c79a96cecb6c51429963279202163836 Mon Sep 17 00:00:00 2001 From: Marc Pujol Date: Sat, 29 Apr 2017 18:49:31 +0200 Subject: [PATCH] Allow passing a pixel diff function as option --- resemble.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resemble.js b/resemble.js index 31bdba3..3e8493d 100644 --- a/resemble.js +++ b/resemble.js @@ -690,6 +690,10 @@ URL: https://github.com/Huddle/Resemble.js errorPixel = errorPixelTransform[options.errorType]; } + if(options.errorPixel && typeof options.errorPixel === "function") { + errorPixel = options.errorPixel; + } + pixelTransparency = isNaN(Number(options.transparency)) ? pixelTransparency : options.transparency; if (options.largeImageThreshold !== undefined) {