This is an old revision of the document!


tiff workflow

  • scan methods
  • lighten/darken pages
  • erase borders, areas, or despeckle
  • density defines resolution of output image
  • units should be given, or else the file units will be undefined, and programs such as GraphicConverter will make the file 72dpi, which will cause conversion problems
  • page defines the canvas size, and will crop the image as necessary
  • example:
    convert -density 150 -units PixelsPerInch -page letter 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
  • -sPAPERSIZE will force the output to be a proper papersize - this actually crops the page to this size which works well when the page is larger than represented and contains crop information
  • example:
    gs -q -dNOPAUSE -sDEVICE=tiff24nc -r150 -sPAPERSIZE=letter -sOutputFile=a.tif a.pdf -c quit
  • requires libtiff
tiffsplit input.tif
  • edit individual files (each page should be a file) as necessary using any graphics program, such as Adobe Photoshop, GraphicConverter etc… (GraphicConverter can edit multi-page tiff files, and keep them intact, although it changes the resolution to 72dpi so you need to run the convert -density command again to fix the file)
  • 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
  • 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
  • requires libtiff
    tiffutil -cat x*.tif -out test.tif
    • this example uses the -c flag, which is set to lzw compression for much smaller files
      tiffcp -c lzw x*.tif output2.tif
  • requires imagemagick command line tools
    convert -adjoin x*.tif output.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
  • 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
    • 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
  • docs/pdf/tiff_workflow.1186586490.txt.gz
  • Last modified: 2008/08/03 00:25
  • (external edit)