Bobrovsky
Bobrovsky

Reputation: 14246

Create PDF from 16bit image using ImageMagick

I am trying to create a PDF from 16 bit grayscale TIFF image. The PDF gets created but it contains an image with decreased bit depth (8 bps instead of 16 bps).

According to PDF Reference, 16 bit images are allowed starting from PDF 1.5. How can I avoid decreasing of the bit depth of the image.

I am using the following command

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

I am using ImageMagick-7.0.5-5-portable-Q16-x64 distribution.

The TIFF I use is available here https://ufile.io/j7dsv

The PDF I get is available here https://ufile.io/szxf8

Here are the tags of my TIFF as identified by AsTiffTagViewer:

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

The identify -verbose indeed reports my TIFF has 16/8-bit depth but afaik it does not matter. The TIFF has 16 bit samples and the fact its samples can be represented using 8 bits does not justify the output PDF.

Upvotes: 1

Views: 538

Answers (1)

dlemstra
dlemstra

Reputation: 8153

At this moment in time ImageMagick only supports writing 8-bit pdf files. You could open an issue here: https://github.com/ImageMagick/ImageMagick/issues and ask us to add support for this.

Upvotes: 1

Related Questions