Browse Source

Notes on Data URIs and academic references

pull/146/head
james.cryer 6 years ago
parent
commit
6170fa2cd1
  1. 13
      README.md

13
README.md

@ -122,6 +122,15 @@ By default, the comparison algorithm skips pixels when the image width or height
You can modify this behaviour by setting the `largeImageThreshold` option to a different value. Set it to **0** to switch it off completely. You can modify this behaviour by setting the `largeImageThreshold` option to a different value. Set it to **0** to switch it off completely.
Resemble.js also supports Data URIs as strings
```javascript
resemble.outputSettings({ useCrossOrigin: false });
var diff = resemble("data:image/jpeg;base64,/9j/4AAQSkZJRgAB...").compareTo(
"data:image/jpeg;base64,/9j/,/9j/4AAQSkZJRg..."
);
```
`useCrossOrigin` is true by default, you might need to set it to false if you're using [Data URIs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs). `useCrossOrigin` is true by default, you might need to set it to false if you're using [Data URIs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).
### Single callback api ### Single callback api
@ -214,6 +223,10 @@ docker build -t huddle/resemble .
docker run huddle/resemble docker run huddle/resemble
``` ```
#### Reference to academic papers
As people have asked in the past, Resemble.js hasn't knowingly implemented any published ideas. RGBA colour comparison is simple and straightforward when working with the Canvas API. The antialiasing algorithim was developed at Huddle over several days of trial-and-error using various false-positive results from PhantomCSS tests.
--- ---
Created by [James Cryer](http://github.com/jamescryer) and the Huddle development team. Created by [James Cryer](http://github.com/jamescryer) and the Huddle development team.

Loading…
Cancel
Save