public static int img_leftmostPoint(BWImage image, int y) { int x1 = 0; while (x1 < image.getWidth() && image.getPixel(x1, y) == 1f) ++x1; return x1; }