import imageio
import os

fnames = []
newNameFolder = 'content-4_2'
path = 'styled_images/'+newNameFolder

for img in os.listdir(path):
        fnames.append(os.path.join(path+"/", img))

fnames.sort()

with imageio.get_writer('gifs/'+newNameFolder+".gif", mode='I',duration = 0.2) as writer:
    for fname in fnames:
        image = imageio.imread(fname)
        writer.append_data(image)
