How Can I Programmatically Build a Multi-Page TIFF out of Many Single Page TIFFs, Using Python?

我的未来我决定 提交于 2019-12-01 15:47:01

问题


I've found, via Google, numerous people asking the same question, but no solutions. The Python Image Library (PIL) has tools for stepping through an already existing multi-page TIFF, but nothing about creating them.

Libraries would hopefully be available on Windows, for Python 2.6.

If there's some freeware out there which will do the trick, I wouldn't mind seeing it, but I was hoping I could accomplish this in Python.


回答1:


A freeware option: Irfanview can do it, even via the command line; this allows you to call it from Python.

From changes version 3.90:

New command line option:

/multitif=(tifname,file1,...,fileN) 

Example to create multipage TIF test.tif from 2 other files:

i_view32 /multitif=(c:\test.tif,c:\test1.bmp,c:\dummy.jpg) 

New command line option:

/append=tiffile 

Example to open c:\test.jpg and append it as (TIF) page to c:\test.tif

i_view32 c:\test.jpg /append=c:\test.tif 

I have used it once and know it works, though limitation on command line length apply.




回答2:


You can use ImageMagick for this (available on Unix and Windows). A linux shell command would be

$ convert *.tif multipage.tif

where *.tif are all your individual tif files.




回答3:


you can use the command utility "tiffutil"



来源:https://stackoverflow.com/questions/2916769/how-can-i-programmatically-build-a-multi-page-tiff-out-of-many-single-page-tiffs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!