// result "image" contains the square of the distance to the closest // "on" pixel in each cell static FloatBWImage distanceTransform(BWImage im, float threshold default .5f, bool brightIsOn) { ret new DistanceTransform().dt(im, threshold, brightIsOn); }