I have a list of image objects. I want to build a folder comprising the images of this list, so that I can download the folder. Is there a way to do this?
CodePudding user response:
The PIL Image object has a save function that you can make use of.
Simply loop over each Image object and call the save
function and provide it with the path of the image.
Example:
for i, img in enumerate(list_of_imgs):
img.save(f"{dir}/{i}.jpg")