import os, sys import fnmatch import Image mask = sys.argv[1] count = 0 # Program to average a set of photos, producing merge.jpg as a result # # version 0.01 # Michael Warot # print mask for file in os.listdir('.'): if fnmatch.fnmatch(file, mask): print file count = count + 1 in2 = Image.open(file) if count == 1: in1 = in2 in1 = Image.blend(in1,in2,(1.0/count)) in1.save("merge.jpg","JPEG")