ImageMagick:如何将多个TIFF文件批量组合到目录中的单个TIFF文件? [英] ImageMagick: how to batch combine multiple TIFF file to a single TIFF file in a directory?

查看:998
本文介绍了ImageMagick:如何将多个TIFF文件批量组合到目录中的单个TIFF文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目录中有600个TIFF文件,c:\ temp。



文件名如下:

  001_1.tif,
001_2.tif,
001_3.tif

002_1.tif,
002_2。 tif,
002_3.tif
....
....
200_1.tif,
200_2.tif,
200_3.tif

组合文件应放在同一目录中,文件应命名为:

  1_merged.tif 
2_merged.tif
.....
.....
200_merged.tif

我正在寻找任何单一的命令行/批处理文件来通过ImageMagick这样做转换 / mogrify 命令或任何其他命令/工具。



<请注意,所花费的总时间不应超过5秒。

解决方案

假设您想要合并600单 - 页面TIFF成一个单页多页TIFF(每组3个),它很简单:

  conv ert 001 _ * .tiff 1_merged.tiff 
convert 002 _ * .tiff 2_merged.tiff
[....]
convert 200 _ *。tiff 200_merged.tiff

请注意,没有人能够保证任何时间/性能基准...至少我们甚至不知道究竟是怎么回事你输入的TIFF是构成的。 (它们是10000x10000像素还是20x20像素?,它们是彩色还是灰度?等等。)



这不同于马克的答案,因为他似乎假设你想把输入文件全部合并成一个1页的图像,原件在一个较大的页面上平铺......


I have 600 TIFF files in a directory, c:\temp.

The file names are like:

001_1.tif,
001_2.tif,
001_3.tif

002_1.tif,
002_2.tif,
002_3.tif
....
....
200_1.tif,
200_2.tif,
200_3.tif

The combined files should be placed in same directory and the files should be named like:

1_merged.tif
2_merged.tif
.....
.....
200_merged.tif

I am looking for any single command-line /batch-file to do so through ImageMagick convert/ mogrify command or any other command/tools.

Please note the overall time taken should not be more than 5 second.

解决方案

Assuming you want to combine the 600 single-page TIFFs into one single multi-page TIFF (per set of 3), it is as simple as:

 convert  001_*.tiff  1_merged.tiff
 convert  002_*.tiff  2_merged.tiff
 [....]
 convert  200_*.tiff  200_merged.tiff

Please note that nobody will be able to guarantee any timing/performance benchmarks... least while we don't even have any idea how exactly your input TIFFs are constituted. (Are they 10000x10000 pixels or are they 20x20 pixels?, Are they color or grayscale?, etc.pp.)

This is different from Mark's answer, because he seems to have assumed you want to combine the input files all into a 1-page image, where the originals are tiled across a larger page...

这篇关于ImageMagick:如何将多个TIFF文件批量组合到目录中的单个TIFF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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