def test_compare(self):
q = quantizer.ImageQuantizer()
qimages = q.quantize_multi([
{'n_colors': 8, 'method': 'random'},
{'n_colors': 16, 'method': 'random'},
{'n_colors': 8, 'method': 'kmeans'},
{'n_colors': 16, 'method': 'kmeans'},
{'n_colors': 8, 'method': 'random+lab'},
{'n_colors': 16, 'method': 'random+lab'},
{'n_colors': 8, 'method': 'kmeans+lab'},
{'n_colors': 16, 'method': 'kmeans+lab'},
], image_filename=self._get_image_path('Lenna.png'))
with mock.patch('image_quantizer.quantizer.plt.show', lambda: None):
quantizer.compare(*qimages)
评论列表
文章目录