This is cool, and a good idea. I will try it out, but I can highly recommend the existing pdiff utility for your image regression testing.
Pdiff allows you to specify perceptual thresholds of visibility, so diffs that are not pixel perfect can still pass if they're 'good enough'. Semi-critical if you render the input images using different browsers or at different resolutions, or if your images have any sub-pixel randomness.
Lots of people (myself included) have used pdiff successfully in production. It doesn't depend on ImageMagick (a bonus in my book). And it's already available in lots of Linux distros.