Home

Fri, May. 2nd, 2008, 01:17 am
Converting multiple TIFFs to one small PDF

OK. So I just spent the last two hours trying to figure this ImageMagick program out. I wanted it to do, relatively, the same thing that Gimp could do with the results being similar.

Problem: I wanted to convert a bunch of TIFF files from our office copier/scanner (one tiff per page) into a self contained PDF.
Complication: Using the straight through no options command "convert" from ImageMagick would produce really REALLY large PDF's - when it wouldn't crash from running out of memory.
Requirement: It needed to be about 200 - 400k MAX and print out at the original size.

So, I tried all of these options with image magick, and a lot of the time, I could "resize" the image, and it looks fine in EOG or The GIMP, but when I would write it out to ps or pdf it would produce an 8.5x11 page, but with the scanned image taking up 1/32 to 1/4 of the page.
The following commands pretty much give me 200k - 500k sizes. The quality of the image (as you would expect) go from decent to pretty good. Since this is just a way of scanning paperwork, converting them to 1bit PDF would do too. The input files were 591k for page1.tif, and 237k for page2.tif with an original resolution of 600x600dpi.
Reduce the resolution to 200dpi, and resize it to 25%, THEN before spitting it out as a Postscript file, increase it back to its original 'print' size
convert page[12].tif \( -colorspace gray \) \( -resample 200x200 \) \( -resize 1275x1650 \) \( -resize 1700x2200 \) step3c.ps
ps2pdf step3c.ps
You can leave out the middle "resizes" but my file size jumped at that point way too much. Leaving out the middle resize, and my file size went from 270k to 355k. Leaving out both resizes it was still at 355k, but the image quality was poorer.
ps2pdf I noticed produced the smallest file size. In fact, using the built in ps2pdf the file size was twice as much!