【发布时间】:2022-02-04 19:46:35
【问题描述】:
我想将 tiff 文件合并为一个,但合并后的文件应该有 n 页。
例如 -- 如果有 2 个 tiff 文件 -- file1(2 page) , file2(3 page),那么合并文件应该有 5 个页面和所有图像。
我是python新手,试过下面的代码,但它不起作用-
from PIL import Image
from PIL import TiffImagePlugin
list_file = ['History and Physical 3.tif','History and Physical 5.tif']
with TiffImagePlugin.AppendingTiffWriter("./test.tiff",True) as tf:
for tiff_in in list_file:
with open(tiff_in) as tiff_in:
im= Image.open(tiff_in)
im.save(tf)
tf.newFrame()
【问题讨论】: