0. 发现一个很完整的中文教程,是个台湾人06年写的,PIL有很多变化,不过作为Quickstart还是不错的
http://tech.seety.org/python/python_imaging.html
标题:以 Python Imaging Library 進行影像資料處理
作者:Yung-Yu Chen (yungyuc) http://blog.seety.org/everydaywork/ <yyc@seety.org>
1.使用PIL实现多张图片垂直合并
转自:http://www.redicecn.com/html/Python/20130523/459.html
# coding: utf-8
# image_merge.py
# 图片垂直合并
# http://www.redicecn.com
# redice@163.com
import os
import Image
def image_resize(img, size=(1500, 1100)):
"""调整图片大小
"""
try:
if img.mode not in ('L', 'RGB'):
img = img.convert('RGB')
img = img.resize(size)
except Exception, e:
pass
return img
def image_merge(images, output_dir='output', output_name='merge.jpg', \