Page 1 of 1

Prevent GIF animation when converting from multiple page PDF

Posted: 2008-10-02T05:51:04-07:00
by znabela
Hi,

I have been trying to convert a PDF to GIF as my experience is that GIF provides the smallest file size.

But the PDF contains multiple pages, that needs to be converted to seperate GIF files.

Situation is that we recieve a PDF from a supplier, where the content needs to be uploaded to an internal web page, but in an image format, that is small in size and download.

I have tried to convert to JPG at 75, even at a 50 compression level (-quality) but the ending image size is too big (about 270kb) and PNG results in a 240Kb file size, where the GIF usually ends up around 100kb at most.

I believe I can get a lower file size by converting to a 256 color depth, but have been unable to locate the appropriate switch for this (-colorspace or -depth did not work, or I am doing something wrong)

Command line:
convert -trim -density 150x150 -units pixelsperinch input.PDF output.gif

Ending result should be multiple .GIF output files just like when converting to JPG or PNG.

/Robert

PS: I tried several searches, but can only find results concerning animation creations, now how to -split into several .GIF files.

Re: Prevent GIF animation when converting from multiple page PDF

Posted: 2008-10-02T10:19:38-07:00
by fmw42
try output_%d.gif to make multiple pages that are numbered

see http://www.imagemagick.org/Usage/files/#write_seq

Re: Prevent GIF animation when converting from multiple page PDF

Posted: 2008-10-02T23:07:47-07:00
by anthony
Or add a +adjoin setting to tell IM to save images as separat files. Having a '%d' in the output filename sets that flag automatically and gives you more control. For example you can use %03d to generate 3 digit numbers (with zero padding).

Re: Prevent GIF animation when converting from multiple page PDF

Posted: 2008-10-03T00:49:45-07:00
by znabela
This is exactly what I needed, thanks! Both of you!