(w, imgs)
return np.vstack(map(np.hstack, rows))
Make a grid from images.

    w    -- number of grid columns
    imgs -- images (must have same size and format)
Make a grid from images.
Make a grid from images .
def mosaic(w, imgs):
    '''Make a grid from images.

    w    -- number of grid columns
    imgs -- images (must have same size and format)
    '''
    imgs = iter(imgs)
    img0 = imgs.next()
    pad = np.zeros_like(img0)
    imgs = it.chain([img0], imgs)
    rows = grouper(w, imgs, pad)
    return np.vstack(map(np.hstack, rows))
def mosaic ( w , imgs ) : imgs = iter ( imgs ) img0 = imgs . next ( ) pad = np . zeros_like ( img0 ) imgs = it . chain ( [ img0 ] , imgs ) rows = grouper ( w , imgs , pad ) return np . vstack ( map ( np . hstack , rows ) )