Wednesday 15 January 2014

Importing images from a directory (Python) -



Importing images from a directory (Python) -

is there way import images within directory (the directory known, don't need find it). have found way of finding out length of directory, i'm not sure how can import images (using pil/pillow) different variables, list or dictionary, length of directory.

i'd start using glob:

from pil import image import glob image_list = [] filename in glob.glob('yourpath/*.gif'): #assuming gif im=image.open(filename) image_list.append(im)

then need list of images (image_list).

python python-imaging-library pillow

No comments:

Post a Comment