@staticmethod
def find_most_common_color(image):
    """
        Find the most common color of an image and return a tuple of color
        upon the mode of the image.

        Return:
        + An integer if the mode is grayscale;
        + A tuple (red, green, blue) of integers (0 to 255) if the mode is RGB;
        + A tuple (red, green, blue, alpha) of integers (0 to 255) if the mode is RGBA.
        """
    colors_info = image.getcolors(image.width * image.height)
    _, most_common_color = max(colors_info, key=lambda item: item[0])
    return most_common_color
