add diff image output functionality and tests
Merge pull request #214 from chenglou/compare-diff

add; diff image output functionality