Answers for "python save images from directory to list"

0

python save images from directory to list

#this function loops over all files/images in a specified folder and stores them together
from PIL import Image
import glob
image_list = []
for filename in glob.glob('yourpath/*): #This downloads all file extentions
#For a specific extention use ('yourpath/*.yourextention')
    im=Image.open(filename)
    image_list.append(im)
Posted by: Guest on February-07-2022

Code answers related to "python save images from directory to list"

Python Answers by Framework

Browse Popular Code Answers by Language