static float bwAverageBrightness(BWImage img) { ret img == null ? 0 : (float) img-averageBrightness(); }