!7 p { RGBImage img = loadImage(#1006358); new MultiSet histogram; for (int rgb : img.pixels) { byte b = to332(rgb); S s = bit(b, 2, "") histogram.add(s); } pnl(histogram.asMap()); } sS bit(int i, int b, S a, S v) { ret testBit(i, b) ? a : v; }