blob: a92645d4ab658b9d9b07cb486f654f9be0c1d2c7 [file] [log] [blame]
import '../image.dart';
import '../util/neural_quantizer.dart';
/**
* Quantize the number of colors in image to 256.
*/
Image quantize(Image src) {
NeuralQuantizer quant = new NeuralQuantizer(src);
for (int i = 0, len = src.length; i < len; ++i) {
src[i] = quant.getQuantizedColor(src[i]);
}
return src;
}