static float[] bwImageColumnBrightnesses(BWImage img) { int w = img.getWidth(), h = img.getHeight(); float[] f = new float[w]; for x to w: f[x] = (float) img.clip(x, 0, 1, h).averageBrightness(); ret f; }