使用 ImageMagick 从 16 位图像创建 PDF

Create PDF from 16bit image using ImageMagick

我正在尝试从 16 位灰度 TIFF 图像创建 PDF。 PDF 已创建,但它包含一个位深度降低的图像(8 bps 而不是 16 bps)。

根据 PDF 参考,从 PDF 1.5 开始允许使用 16 位图像。如何避免降低图像的位深度。

我正在使用以下命令

convert tile-gray-16.tif -compress zip -depth 16 output.pdf

我正在使用 ImageMagick-7.0.5-5-portable-Q16-x64 发行版。

我使用的 TIFF 在这里可用 https://ufile.io/j7dsv

我得到的 PDF 可以在这里找到 https://ufile.io/szxf8

这是 AsTiffTagViewer 识别的我的 TIFF 标签:

ImageWidth (1 Short): 256
ImageLength (1 Short): 256
BitsPerSample (1 Short): 16
Compression (1 Short): Uncompressed
Photometric (1 Short): MinIsBlack
FillOrder (1 Short): Msb2Lsb
SamplesPerPixel (1 Short): 1
RowsPerStrip (1 Short): 256
XResolution (1 Rational): 96
YResolution (1 Rational): 96
PlanarConfig (1 Short): Contig
TileWidth (1 Short): 256
TileLength (1 Short): 256
TileOffsets (1 Long): 16
TileByteCounts (1 Long): 131072

identify -verbose 确实报告说我的 TIFF 有 16/8 位深度,但据我所知这无关紧要。 TIFF 有 16 位样本,它的样本可以用 8 位表示的事实并不能证明输出 PDF 是正确的。

目前ImageMagick只支持写入8位pdf文件。您可以在此处提出问题:https://github.com/ImageMagick/ImageMagick/issues 并要求我们为此添加支持。