Improve the threshold tests

Let's use a pseudo-random image (with fixed seed) rather than a
linear gradient, since the gradients do not differentiate well
across the various thresholding algorithms.

With a 10x10 randomly generated image using seed 0xdeadbeef, I'm
happy to note that every auto-thresholding algorithm produces a
different threshold!