def normalize_brightness_dict(brightness_dict):
    """Usually the distribution of the character brightness for a given font
    is not as diverse as we would like it to be. This results in a pretty
    poor result during the image to ASCII art conversion (if used as-is).

    Because of this it's much better to normalize the brightness distribution.
    Normalization widens the distribution ranges to 8-bit 0-255 range.

    Args:
        brightness_dict (dict): A map of characters to brightness.

    Returns:
        dict: normalized map of characters to brightness.

    """

    b_min, b_max = 255, 0
    for brightness in brightness_dict.values():
        b_min = min(b_min, brightness)
        b_max = max(b_max, brightness)

    def widen(b):
        """Using the min and max bounds to widen the char brightness"""
        return int(round( ( (b - b_min) / (b_max - b_min) ) * 255 ))

    return {char: widen(brightness) for char, brightness in brightness_dict.items()}