from PIL import Image import numpy as np def main(): images = [] print("generating") for i in range(100): #c = np.random.randint(0,255+1, size=3) #ar = np.zeros((1000,4000,3)).astype(np.uint8) #ar[:,:,:] = c ar = np.random.randint(0,255+1,size=(200,800,3)) ar = ar.astype(np.uint8) img = Image.fromarray(ar) images.append(img) print("writing") for i,img in enumerate(images): img.save("img_test_{:05}.png".format(i)) if __name__ == '__main__': main()