【发布时间】:2014-04-18 18:17:37
【问题描述】:
我正在使用以下循环将大约 250 个 .tif 文件转换为平铺金字塔 .tif 文件,每个文件大约 15 到 35 mb:
for i in *.tif; do convert $i -define tiff:tile-geometry=256x256 -compress jpeg 'ptif:tiled-'$i; done
这可能适用于一半多一点的图像:我得到一个压缩的平铺 .tif 文件,大小约为原始文件的 1/4。对于那些不起作用的,我得到一个输出的图像文件,它可能大约 4,000 字节大,-debug all 似乎弹出的一个错误是Bogus input colorspace. "JPEGLib"。如果通过 IIP 图像服务器传输这些图像,则这些图像不会出现,并且不会在图像查看器中打开。
我已将其本地化为 -compress jpeg 参数。如果我在没有压缩的情况下运行,或者像-compress LossLess JPEG 这样的无损压缩,它似乎可以工作,但平铺图像(显然)比原始图像大,这是我试图避免的。
对一个图像运行tiffinfo,但该图像不能转换为我得到的图像:
坏了
$ tiffinfo WH-001.tif
TIFF Directory at offset 0x106842c (17204268)
Image Width: 1735 Image Length: 2479
Resolution: 72, 72 pixels/inch
Bits/Sample: 8
Compression Scheme: None
Photometric Interpretation: RGB color
Extra Samples: 1<unassoc-alpha>
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4
Rows/Strip: 1
Planar Configuration: single image plane
Page Number: 0-1
DocumentName: WH-001.tif
工作
$ tiffinfo WH-090.tif
TIFFReadDirectory: Warning, Unknown field with tag 32934 (0x80a6) encountered.
TIFF Directory at offset 0xd4 (212)
Subfile Type: (0 = 0x0)
Image Width: 2800 Image Length: 4160
Resolution: 600, 600 pixels/inch
Bits/Sample: 8
Compression Scheme: None
Photometric Interpretation: RGB color
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 3
Rows/Strip: 3
Planar Configuration: single image plane
Software: Oi/GFS, writer v00.06.02
Tag 32934: 0
ICC Profile: <present>, 3144 bytes
虽然我不知道如何判断为什么一个坏了,为什么另一个工作。
【问题讨论】:
标签: image image-processing imagemagick tiff tile