ImageMagick : convert $infile $tmp0 -compose Difference -composite -threshold $thresh

Version imprimable