Browse Source

Merge pull request #22 from doryphores/large-image-threshold-option

Add largeImageThreshold option to control when to skip pixels
pull/23/head
James Cryer 10 years ago
parent
commit
4e56f0e0ba
  1. 7
      README.md
  2. 6
      resemble.js

7
README.md

@ -63,11 +63,16 @@ resemble.outputSettings({
blue: 255
},
errorType: 'movement',
transparency: 0.3
transparency: 0.3,
largeImageThreshold: 1200
});
// resembleControl.repaint();
```
By default, the comparison algorithm skips pixels when the image width or height is larger than 1200 pixels. This is there to mitigate performance issues.
You can switch this modify this behaviour by setting the `largeImageThreshold` option to a different value. Set it to **0** to switch it off completely.
--------------------------------------
Created by [James Cryer](http://github.com/jamescryer) and the Huddle development team.

6
resemble.js

@ -36,6 +36,8 @@ URL: https://github.com/Huddle/Resemble.js
var errorPixelTransformer = errorPixelTransform.flat;
var largeImageThreshold = 1200;
_this['resemble'] = function( fileData ){
var data = {};
@ -347,7 +349,7 @@ URL: https://github.com/Huddle/Resemble.js
var skip;
if( (width > 1200 || height > 1200) && ignoreAntialiasing){
if(!!largeImageThreshold && ignoreAntialiasing && (width > largeImageThreshold || height > largeImageThreshold)){
skip = 6;
}
@ -595,6 +597,8 @@ URL: https://github.com/Huddle/Resemble.js
pixelTransparency = options.transparency || pixelTransparency;
largeImageThreshold = options.largeImageThreshold || largeImageThreshold;
return this;
};

Loading…
Cancel
Save