static BitSet used332Colors(BufferedImage img) { ret used332Colors(RGBImage(img)); } static BitSet used332Colors(RGBImage img) { int w = img.w(), h = img.h(); new BitSet bs; for y to h: for x to w: setBit(bs, ubyteToInt(to332(img.getInt(x, y)))); ret bs; }