convert pdf->jpg is too slow. why?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
scofer

convert pdf->jpg is too slow. why?

Post by scofer »

I tried to convert PDF file (~1-2 MB) and it took ~ 30 min. why?

I have fast computer (p4 2.4 GHz, 1G RAM). What's the reason?

May be it would be faster if i will convert PDF to PNG or GIF?
scofer

Re: convert pdf->jpg is too slow. why?

Post by scofer »

Anybody know the reason?

Maybe I should convert to another extension?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert pdf->jpg is too slow. why?

Post by magick »

How many pages does your PDF image have? If its many, chances are the images are being cached to disk which is 1000 times slower than in-memory caching. To fix, use Ghostscript from the command line which should speed up processing significantly.
scofer

Re: convert pdf->jpg is too slow. why?

Post by scofer »

Maybe I should convert to different extension, i.e. GIF or PNG. Will it be faster?
scofer

Re: convert pdf->jpg is too slow. why?

Post by scofer »

For example:

i convert PDF file (~20MB) to JPEG with Adobe Acrobat (it takes ~5 min).

With ImageMagick it takes more than 1 hour (!!!)
Last edited by scofer on 2008-01-12T13:51:27-07:00, edited 1 time in total.
scofer

Re: convert pdf->jpg is too slow. why?

Post by scofer »

magick wrote:How many pages does your PDF image have? If its many, chances are the images are being cached to disk which is 1000 times slower than in-memory caching. To fix, use Ghostscript from the command line which should speed up processing significantly.
~ 100 pages.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert pdf->jpg is too slow. why?

Post by magick »

That's the problem. The 100 pages are first cached to memory and when memory is exhausted they are cached to disk. Using Ghostscript directly from the command line is the most promising method of speeding up the conversion.
scofer

Re: convert pdf->jpg is too slow. why?

Post by scofer »

magick wrote:That's the problem. The 100 pages are first cached to memory and when memory is exhausted they are cached to disk. Using Ghostscript directly from the command line is the most promising method of speeding up the conversion.
Thanks. I will try and report about result ;)
astroturf

Re: convert pdf->jpg is too slow. why?

Post by astroturf »

I found this thread from searching. What exactly did you mean by using ghostscript from the command line? I thought ImageMagick did the actual converting. Is ghostscript capable of outputing images? I tried to look at their docs but they were down :? .

Can you provide an example? I have a 1000+ page document that is nearly impossible to work with using convert.

Sorry to post in your thread scofer.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert pdf->jpg is too slow. why?

Post by anthony »

An example in in IM examples, under Text to Image, Postscript...
http://imagemagick.org/Usage/text/#postscript
Near the end of that part, just before the nest section on "draw text".

Also you can remove all but the first page wanted from the postscript before feedding the postscript to IM that way IM only has to convert one page.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
astroturf

Re: convert pdf->jpg is too slow. why?

Post by astroturf »

Thank you very much. Just what I needed.
Post Reply