python 合并图片任意方式
2014-07-29 21:30
183 查看
输入照片列表,按照m行n列的方式合并图片并显示
import cv2 import numpy as np import Image import cv2.cv as cv def image_joint(image_list,opt):#opt= [1,4]一行四列 image_num=len(image_list) image_size=image_list[0].size height=image_size[1] width=image_size[0] new_height=opt[0]*height new_width=opt[1]*width new_img=Image.new('RGB',(new_width,new_height),255) x=y=0 x_count=0 y_count=0 for img in image_list: print 'ccc' if y_count<opt[0] : if x_count<opt[1]: new_img.paste(img,(x,y)) x+=width x_count+=1 print 'hi' continue print 'hellp' x=0 x_count=0 y+=height new_img.paste(img,(x,y)) x+=width new_img.show() return new_img
相关文章推荐
- 使用GD库合并图片。。制作水印的方式也是类似的
- python合并图片
- OpenCV实现任意大小图片的合并
- 任意文字,任意图片,彩色lcd显示,画面实时更新,全部通过非gui方式实现了。
- phpexcel中文教程-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
- 发一个图片合并python程序
- Python 通过URL打开图片的几种方式
- [Python 爬虫之路4] 使用selenium爬取知乎任意一个问题下,所有回答中的图片
- phpexcel中文教程-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
- Python+ImageMagick实现多图片合并为一个pdf文件
- 黄聪:phpexcel中文教程-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
- PHPExcel-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
- Python 图片尺寸缩放的4种方式
- python、matlab、c++的括号增加次序,以及图片存储方式
- python爬虫(1)下载任意网页图片
- python字典合并哪种方式效率最高?
- phpexcel中文教程-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
- phpexcel中文教程-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
- caffe的python接口以opencv的方式读取视频,图片做分类时出错的解决
- python---以不变形的方式调整图片大小