python纵向合并任意多个图片,files是要拼接的文件list
# -*- coding:utf-8 -*-
def mergeReport(files):
from PIL import Image
import numpy as np
baseimg=Image.open(files[0])
sz = baseimg.size
basemat=np.atleast_2d(baseimg)
for file in files[1:]:
im=Image.open(file)
#resize to same width
sz2 = im.size
if sz2!=sz:
im=im.resize((sz[0