downsample_image(): Added a default value of "numpy" for the mode argument. Changed the conversion from PIL image to numpy array to remove the alpha channel.
bg_color_identifier(): Simplified the computation of the number of lines for the background selection. Changed the output format of the function to return bord_unique alongside bg_color as another possible candidate for background color.
selector_otsu(): Simplified the code by using np.mean() instead of np.sum() and dividing by the total number of pixels. This provides a more direct measure of the proportion of background pixels. Simplified the if/else statement at the end to remove redundancy.
downsample_image(): Added a default value of "numpy" for the mode argument. Changed the conversion from PIL image to numpy array to remove the alpha channel.
bg_color_identifier(): Simplified the computation of the number of lines for the background selection. Changed the output format of the function to return bord_unique alongside bg_color as another possible candidate for background color.
selector_otsu(): Simplified the code by using np.mean() instead of np.sum() and dividing by the total number of pixels. This provides a more direct measure of the proportion of background pixels. Simplified the if/else statement at the end to remove redundancy.