有多种可能性,具体取决于实际发生的情况,如果不查看每个阶段的输入和输出文件以及实际处理,很难判断。
有时缩略图是 TIFF 中的第一个条目,因此您可以选择仅从 TIFF 中的第二个条目(从零开始计数)开始加载:
magick input.tif[1--1] ...
如果您无法避免加载第一个/最后一个条目,您可以加载所有内容,然后删除您不想要的任何内容。所以,如果我检查这样的图像,我会看到它有 6 个场景,即。 0 到 5:
magick identify image.tif
image.tif[0] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 283124B 0.000u 0:00.000
image.tif[1] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[2] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[3] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[4] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[5] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
如果我想删除第一个和最后一个条目,在处理剩余条目之前,我可以这样做:
magick image.tif -delete 0,-1 -format "Processing scene: %s Resolution: %G\n" -write info: <FURTHER PROCESSING OF EACH PAGE> result-%d.png
样本输出
magick image.tif -delete 0,-1 -format "Processing scene: %s Resolution: %G\n" -write info: -crop 10x10+0+0 result-%d.png
Processing scene: 1 Resolution: 2448x3168
Processing scene: 2 Resolution: 2448x3168
Processing scene: 3 Resolution: 2448x3168
Processing scene: 4 Resolution: 2448x3168
您可以通过检查您的图像来确定是否是这种情况:
-
exiftool YOURIMAGE 并寻找“子文件类型:多页图像的单页”
-
tiffinfo YOURIMAGE 并查找条目数
-
magick identify YOUIRIMAGE 并寻找不止一行的输出
有时缩略图包含在元数据中,因此您可以尝试使用以下方法之一去除这些缩略图:
magick INPUT.JPG -strip RESULT.JPG
jhead -dt YOURIMAGE
exiftool -thumbnailimage= YOURIMAGE
您还可以通过以下方式找到这些:
-
exiftool YOURIMAGE 并寻找嵌入的二进制数据
magick identify -verbose YOURIMAGE
jhead YOURIMAGE