Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ghostscript PDF -> TIFF conversion is awful for me, people rave about it, I alone look sullen [closed]

My stomach churns when I see this kind of output.

http://www.freeimagehosting.net/uploads/e1097a5a10.jpg

and this was my command as suggested by Best way to convert pdf files to tiff files

gswin32c.exe -q -dNOPAUSE -sDEVICE=tiffg4 -sOutputFile=a.tif a.pdf -c quit

What am I doing wrong?

(commercial products will not be considered)

like image 774
Setori Avatar asked Oct 21 '08 10:10

Setori


People also ask

What is tiffg4?

TIFF, Group 4 Compressed Bitmap. Description. A tag-based file format for storing and interchanging raster images; in this subtype, TIFF wraps a bitmap compressed using ITU_G4 (ITU-T T. 6.


2 Answers

tiffg4 is a black&white output device. You should use tiff24nc or tiff12nc as the output device colour PDFs - see ghostscript output devices. These will be uncompressed but you could put the resulting TIFFs through imagemagick or similar to resave as compressed TIFF.

like image 136
danio Avatar answered Sep 21 '22 08:09

danio


I have been using ImageMagick for quite a sometime. It's very nice tool with a lot of features.

Install ImageMagick and run following command. This is what I used on Linux, you may have to replace convert with the correct one.

Below command converts PDFs to CCITT Group 3 standard TIFs (Fax standard):

convert -define quantum:polarity=min-is-white \
        -endian MSB \
        -units PixelsPerInch \
        -density 204x196 \
        -monochrome \
        -compress Fax \
        -sample 1728 \
        "input.pdf" "output.tif"

Also you may use GraphicsMagick, it is also similar to ImageMagick, but ImageMagick more concerns with quality than speed.

like image 30
Amil Waduwawara Avatar answered Sep 19 '22 08:09

Amil Waduwawara