unit test for image quantization routine
(#558)