Bisection Method
This version uses the Bisection Method to search for the largest size label, using fewer iterations than before, and achieving more accurate results.
Now the algorithm uses a tolerance for accuracy of the height of the label bounding box in pixels, which is by default 0.01. Using this tolerance, the bisection method takes around 18 iterations on average to find a solution, as compared to on average around 100 with the previous linear search method, which was only accurate to a tolerance of 1.