如何使用 Python 以编程方式从许多单页 TIFF 中构建多页 TIFF? [英] How Can I Programmatically Build a Multi-Page TIFF out of Many Single Page TIFFs, Using Python?

查看:48
本文介绍了如何使用 Python 以编程方式从许多单页 TIFF 中构建多页 TIFF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现,通过 Google,很多人都在问同样的问题,但没有解决方案.Python 图像库 (PIL) 具有用于单步执行现有多页 TIFF 的工具,但没有关于创建它们的工具.

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.

库有望在 Windows 上可用,适用于 Python 2.6.

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

如果有一些免费软件可以解决这个问题,我不介意看到它,但我希望我能用 Python 完成这个.

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.

推荐答案

一个免费软件选项:Irfanview 可以做到,甚至通过命令行;这允许您从 Python 调用它.

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

从更改版本 3.90:

From changes version 3.90:

新的命令行选项:

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

从其他 2 个文件创建多页 TIF test.tif 的示例:

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

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

新的命令行选项:

/append=tiffile 

打开 c:\test.jpg 并将其作为 (TIF) 页面附加到 c:\test.tif

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.

这篇关于如何使用 Python 以编程方式从许多单页 TIFF 中构建多页 TIFF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆