approximate test for lossy image writing

Fixes #152

A fuzzy test for if an image with lossy compression is approximately equal to another image.