def mipmap_levels(base_width, base_height):
    """Return max number of mipmap for the size

    Args:
        base_width (int): Width source
        base_height (int): Height source

    Returns:
        int: Number of mipmap levels
    """
    width = base_width
    height = base_height
    levels = 1

    while width > 1 or height > 1:
        width = width // 2 or 1
        height = height // 2 or 1
        levels += 1

    return levels