toBlackAndWhite static method
Implementation
static List<int> toBlackAndWhite(List<int> rgba, {int tolerance = 75}) {
int white = 255;
int black = 0;
rgba = toGrayScale(rgba);
int whitest = getWhitest(rgba);
for (int i = 0, len = rgba.length; i < len; i += 4) {
int value = (rgba[i] < (whitest - tolerance)) ? black : white;
rgba[i] = value;
rgba[i + 1] = value;
rgba[i + 2] = value;
}
return rgba;
}