Page 1 of 1

Can not convert pdf to tiff with jpeg conversion

Posted: 2013-12-26T23:36:03-07:00
by gmr
Hi,

I am running imagemagick 6.8.3-5 on an solaris11 machine.

# convert --version
Version: ImageMagick 6.8.3-5 2013-08-21 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib fftw freetype jng jpeg lcms lzma openexr pango png ps tiff x xml zlib

The problem is, I am not able to convert pdf into tiff with jpeg compression. Is this a limitation of imagemagick or am I doing something wrong here?

# convert mozilla.pdf -compress JPEG mozilla2.tiff
convert: BitsPerSample 16 not allowed for JPEG. `JPEGSetupEncode' @ error/tiff.c/TIFFErrors/562.

I was able convert from jpg to tiff using jpeg conversion though. Could someone help me out here, please? Am I missing something here??

Thanks in Advance!
gmr

Re: Can not convert pdf to tiff with jpeg conversion

Posted: 2013-12-26T23:47:48-07:00
by fmw42
It appears that you cannot compress 16-bit data with jpg compression. Looks like libtiff does not allow that.

try

convert mozilla.pdf -depth 8 -compress JPEG mozilla2.tiff

Re: Can not convert pdf to tiff with jpeg conversion

Posted: 2013-12-31T03:13:43-07:00
by gmr
Thanks for the tip. I also found similar posts on web. I tried the following. But I am still not able convert it successfully.

$ convert testsample2.pdf -compress JPEG testsample2.tiff
convert: BitsPerSample 16 not allowed for JPEG. `JPEGSetupEncode' @ error/tiff.c/TIFFErrors/562.
$ convert testsample2.pdf -depth 8 -compress JPEG testsample2.tiff
convert: Bogus input colorspace. `JPEGLib' @ error/tiff.c/TIFFErrors/562.
$ identify -verbose testsample2.pdf | grep 'Colorspace'
Colorspace: sRGB
Colorspace: sRGB
Colorspace: sRGB
Colorspace: sRGB
$ convert testsample2.pdf -depth 8 -colorspace sRGB -compress JPEG testsample2.tiff
convert: Bogus input colorspace. `JPEGLib' @ error/tiff.c/TIFFErrors/562.
$

Any suggestions how to tackle the latest error?

Thanks in advance!
gmr

Re: Can not convert pdf to tiff with jpeg conversion

Posted: 2013-12-31T03:42:32-07:00
by magick
Try upgrading your release of ImageMagick and libTIFF. Converting from PDF to TIFF worked without complaint for us with ImageMagick 6.8.8-1 and LIBTIFF, Version 4.0.3.

Re: Can not convert pdf to tiff with jpeg conversion

Posted: 2013-12-31T03:59:39-07:00
by gmr
I am running 6.8.3-5.

$ convert -version
Version: ImageMagick 6.8.3-5 2013-08-21 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib fftw freetype jng jpeg lcms lzma openexr pango png ps tiff x xml zlib
$

Does that mean, the version that I am using doesn't support the attempted conversion?

Thanks!
gmr.

Re: Can not convert pdf to tiff with jpeg conversion

Posted: 2013-12-31T04:02:10-07:00
by gmr
I am running libtiff-3.9.5.

I am just trying to understand whether this issue is due to wrong conversion specifiers or the limitation of imagemagick itself.

Thanks!
gmr

Re: Can not convert pdf to tiff with jpeg conversion

Posted: 2013-12-31T10:50:26-07:00
by snibgo
According to http://en.wikipedia.org/wiki/JPEG there is a 12-bit JPEG format, "but this format is not as widely supported."

Current IM (v6.8.8-0) silently converts 16-bit/channel images to 8-bit. Eg:

Code: Select all

convert -size 1x1000 gradient: -depth 16 -compress jpeg t.tiff
identify -verbose shows the result is 8-bit.