def save_images(images, directory, filename):
    if not os.path.exists(directory):
        os.makedirs(directory)
    w = sum(i.size[0] for i in images)
    mh = max(i.size[1] for i in images)
    result = PIL.Image.new("RGBA", (w, mh))
    x = 0
    for i in images:
        result.paste(i, (x, 0))
        x += i.size[0]
    result.save(directory+'/'+filename)
dataset/ETHPy150Open dpkingma/nips14-ssl/anglepy/paramgraphics.py/save_images/original