Browse Source

Add ignoreAlpha option

pull/110/head
Kamil Bielawski 7 years ago
parent
commit
f3a6368673
  1. 4
      demoassets/main.js
  2. 1
      index.html
  3. 15
      resemble.js

4
demoassets/main.js

@ -121,6 +121,10 @@ $(function(){
resembleControl.ignoreAntialiasing();
}
else
if($this.is('#alpha')){
resembleControl.ignoreAlpha();
}
else
if($this.is('#same-size')){
resembleControl.scaleToSameSize();
}

1
index.html

@ -98,6 +98,7 @@
<button class="btn active" id="less">Ignore less</button>
<button class="btn" id="colors">Ignore colors</button>
<button class="btn" id="antialising">Ignore antialiasing</button>
<button class="btn" id="alpha">Ignore alpha</button>
</div>
<br/>

15
resemble.js

@ -692,6 +692,21 @@ URL: https://github.com/Huddle/Resemble.js
if(hasMethod) { param(); }
return self;
},
ignoreAlpha: function() {
tolerance.red = 16;
tolerance.green = 16;
tolerance.blue = 16;
tolerance.alpha = 255;
tolerance.minBrightness = 16;
tolerance.maxBrightness = 240;
ignoreAntialiasing = false;
ignoreColors = false;
if(hasMethod) { param(); }
return self;
},
repaint: function(){
if(hasMethod) { param(); }
return self;

Loading…
Cancel
Save