Khan/KaTeX — pull request #147 by kevinb7 (2014-10-03 20:00:37+00:00)
Title: Image comparison using ImageMagick's "compare"

An attempt to address issue https://github.com/Khan/KaTeX/issues/143. I've moved all of the reference images from the Huxleyfolder into a sibling folder called "originals". When huxley runs it create new images in the Huxleyfolder. To compare the images, run ```node compare.js```. The script calls ImageMagick's ```compare``` command so ImageMagick will need to be installed for this work. Fortunately, ImageMagick is part of the travis-ci environment so it should be easy to automate this.

Right now it spits out text the console in the following format:
```
BasicTest: 0 @ 0,0
FractionTest: 0 @ 0,0
NestedFractions: 0 @ 0,0
...
```
The script use the ```-subimage-search``` to deal with differences in image size arising from a bug in node-huxley: https://github.com/chenglou/node-huxley/issues/76. It also uses AE (Absolute Error) to calculate the error. There are other metrics available: http://www.imagemagick.org/script/command-line-options.php#metric.