Issue
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?
Solution
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")
Answered By - Tharun K Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.