add diff image output functionality and tests