import itertools


def split_mosaic(image, tile_size):
    """
    Returns image after splitting image to multiple tiles of
    of tile_size.

    Args:
        image: str an image array to split
        tile_size: tuple size each image in the split is resized to

    Returns:
        Returns list of images
    """
    # Set number of tiles
    shape = image.shape
    x_tiles = shape[0] // tile_size[0]
    y_tiles = shape[1] // tile_size[1]

    tile_size_x = tile_size[0]
    tile_size_y = tile_size[1]

    images = []
    # Set each of the tiles with an image in images_in_path
    indices = list(itertools.product(range(x_tiles), range(y_tiles)))
    for index in range(len(indices)):
        x, y = indices[index]
        images.append(
            image[
                x * tile_size_x : tile_size_x * (x + 1),
                y * tile_size_y : tile_size_y * (y + 1),
            ]
        )
    return images