convert to TIFF with JPEG compression, single strip/tile, YBrCR
Posted: 2016-03-07T14:25:44-07:00
I am attempting to convert multipage color PDFs to TIFF for import into a document imaging system. The system will only handle the final TIFFs properly if they are stored in one of the following formats:
JPEG - Support only if single strip/tile, and Photometric Interpretation is YCbCr
(OJPEG also supported, but I am ignoring that option for the time being)
These PDF files had been previously converted into color TIFFs using LSW compression, so I can also convert those TIFFS to the JPEG compression format if that is easier.
The biggest problem I have at the moment is figuring out how to create the TIFFs as single strip/tile. I'm not sure if this is even the proper terminology, as I couldn't find anything referencing the option in the forums. I tried setting "-define tiff:rows-per-strip=0", as well as setting it to a very high number such as 300000.
This succeeds in converting an LZW TIFF to JPEG, but white color gets translated to purple (0,128,128), and the strip/tiling is still wrong for our app.
convert Y:\TestMultipage.1.tif -compress jpeg -set colorspace YCbCr Y:\TestMultipage.tif
The following throws an error:
c:\temp\idmhelp>convert Y:\TestMultipage.pdf -compress jpeg -set colorspace YCbCr Y:\TestMultipage.tif
convert.exe: Invalid td_samplesperpixel value. `TIFFVStripSize64' @ error/tiff.c/TIFFErrors/557.
convert.exe: Bogus input colorspace. `JPEGLib' @ error/tiff.c/TIFFErrors/557.
If I remove the colorspace option it is successful, but our app won't take the RGB colorspace that it results in.
What function or parameters should I be looking at for the colorspace and strip/tile settings?
JPEG - Support only if single strip/tile, and Photometric Interpretation is YCbCr
(OJPEG also supported, but I am ignoring that option for the time being)
These PDF files had been previously converted into color TIFFs using LSW compression, so I can also convert those TIFFS to the JPEG compression format if that is easier.
The biggest problem I have at the moment is figuring out how to create the TIFFs as single strip/tile. I'm not sure if this is even the proper terminology, as I couldn't find anything referencing the option in the forums. I tried setting "-define tiff:rows-per-strip=0", as well as setting it to a very high number such as 300000.
This succeeds in converting an LZW TIFF to JPEG, but white color gets translated to purple (0,128,128), and the strip/tiling is still wrong for our app.
convert Y:\TestMultipage.1.tif -compress jpeg -set colorspace YCbCr Y:\TestMultipage.tif
The following throws an error:
c:\temp\idmhelp>convert Y:\TestMultipage.pdf -compress jpeg -set colorspace YCbCr Y:\TestMultipage.tif
convert.exe: Invalid td_samplesperpixel value. `TIFFVStripSize64' @ error/tiff.c/TIFFErrors/557.
convert.exe: Bogus input colorspace. `JPEGLib' @ error/tiff.c/TIFFErrors/557.
If I remove the colorspace option it is successful, but our app won't take the RGB colorspace that it results in.
What function or parameters should I be looking at for the colorspace and strip/tile settings?