import Image import tkFileDialog # Input and output file setup files = tkFileDialog.askopenfilenames() outfile = 'ask' # Read images images = [] w = 0 h = 0 for file in files: image = Image.open(file) w += image.size[0] height = image.size[1] if height > h: h = height images.append(image) # Write composed image if w > 0 and h > 0: composition = Image.new('RGBA',(w,h)) x = 0 for image in images: composition.paste(image,(x,0,x+image.size[0],image.size[1])) x += image.size[0] if outfile == 'ask': outfile = tkFileDialog.asksaveasfilename() composition.save(outfile) print "Done!"