static Image2B image332to2bByEqualityToColor(Color color, Image332 img) { if (img == null) null; int w = img.getWidth(), h = img.getHeight(); Image2B i2b = new(w, h); int reducedColor = to332_int(color); for y to h: for x to w: if (img.get332Pixel(x, y) == reducedColor) i2b.setPixel(x, y); ret i2b; }