How to open multiple images using Wand and Python

I'm trying to use imagemagick to take several JPGs and lay them out on a pdf

I'm at the beginning of the project and I do not understand how to open the multiple images and do this.

My research indicated to me that this is possible on the command line by simply passing the convert() function multiple files. experience is telling me that this isn't how it's done with Wand, but I can't figure out how!

Any advice is appreciated!


ANSWERS:


  • my example code is below.
  • before you excute this code, insert the dir path.

import os
from wand.image import Image
from wand.display import display

path = "____absolute_dir_path____ (ex. /home/kim/work/)"

dirList=os.listdir(path)
for fname in dirList:
    print fname
    with Image(filename=path+fname) as img:
        print img.size


 MORE:


 ? Compositing two images with python wand
 ? cx_freeze over Python Wand (imagemagick)
 ? Writing animated gif using Wand and ImageMagick
 ? convert and crop image in tiles with python
 ? How to Convert PSD into PNG, using Python Wand / ImageMagick?
 ? Use python wand to grayscale image
 ? Python wand: composite image with transparency
 ? Python wand: composite image with transparency
 ? Python wand: composite image with transparency
 ? Python Wand convert PDF to PNG disable transparent (alpha_channel)