#author@南方人啦
import os
from PIL import Image
#编写splitimage实现将指定的src图片分割成rownumXcolnum数量的小方块
def splitimage(src, rownum, colnum, dstpath):
img = Image.open(src)
w, h = img.size#图片大小
if rownum <= h and colnum <= w:
print('Original image info: %sx%s, %s, %s' % (w, h, img.format, img.mode))
print('开始处理图片切割, 请稍候...')<