This is an old revision of the document!
tiff workflow
convert pdf to tif
- requires imagemagick command line tools
- density defines resolution of output image:
convert -density 150 SN-085.pdf SN-085.tif
- requires Ghostscript (seems slower than imagemagick method, although imagemagick uses gs with the pnmraw output device)
- -q = quiet mode
- -dNOPAUSE = don't pause and ask questions after each page
- -r = custom resolution
- example:
gs -q -dNOPAUSE -sDEVICE=tiff24nc -r150 -sPAPERSIZE=letter -sOutputFile=a.tif a.pdf -c quit
split multi-page tiff into individual files
- requires libtiff
tiffsplit input.tif
edit tiff pages
- edit individual files (each page should be a file) as necessary using any graphics program, such as photoshop
- since individual tiff files are not the final work product, it would be best to not use compression, since some tools do not work well with certain compression schemes
convert tif to pdf
- requires libtiff
- single file (no compression):
tiff2pdf -p letter -o output.pdf input.pdf
- single file (zip compression):
tiff2pdf -z -p letter -o output.pdf input.pdf
- single file (jpeg compression, 60% quality):
tiff2pdf -j -q60 -p letter -o output.pdf input.pdf
- single file (zip compression, with document metadata):
tiff2pdf -z -p letter -cprogramname -aauthorname -tdocumenttitle -sdocumentsubject -o output.pdf input.pdf
- multiple files:
ls -1L *.tif | while read file;do tiff2pdf -p letter -o "${file}".pdf "${file}" done
- requires Ghostscript
tiff2ps -2 a.tif | gs -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=a.pdf - -c quit
combine multiple tif files
- requires libtiff
tiffutil -cat x*.tif -out test.tif
- requires imagemagick command line tools
convert -adjoin x*.tif output.tif
combine multiple pdf files
- requires libtiff
- this example uses the -c flag, which is set to lzw compression for much smaller files
tiffcp -c lzw x*.tif output2.tif
- requires pdftk
- this example does not include compression, so with uncompressed tif images, the file size is very large
pdftk *.pdf cat output combined.pdf
convert tif to smaller file size
- requires libtiff
- compress file using lzw compression:
tiffcp -c lzw input.tif output.tif
- convert to grayscale, and use lzw compression:
tiff2bw -c lzw input.tif output.tif
- compress file using CCITT Group 4 compression:(The CCITT Group 3 and Group 4 compression algorithms can only be used with bilevel data - 1 bit black and white images)
tiffcp -c g4 input.tif output.tif
- requires imagemagick command line tools
- convert to 1-bit, using CCITT Group 4 compression (black and white)
convert -monochrome -compress Groupt4 input.tif output.tif
- convert to 1-bit (black and white) specifying threshold for black:
convert -monochrome -black-threshold 35768 input.tif output.tif
- convert a bunch of files into monochrome 1-bit images, with CCITT Group 4 compression, then combine them into one multipage tiff file, and finally convert them into one pdf file using zip compression:
ls -1L x*.tif|while read file; do convert -monochrome -compress Group4 "${file}" "${file}".bw.tif; done tiffutil -cat *.bw.tif -out tifoutput.tif tiff2pdf -z -p letter -o output.pdf tifoutput.tif