convert huge pdf to jpeg -> ultraslow performacne

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
stephan0h
Posts: 4
Joined: 2011-10-30T13:16:12-07:00
Authentication code: 8675308

convert huge pdf to jpeg -> ultraslow performacne

Post by stephan0h »

Hi,
I'm using imagemagick's convert-command for converting pdf-files to jpeg.

My machine runs on linux, it has 4GB RAM and a core dual processor.

Now I've got a quite big pdf which I want to convert: 180*180 cm with 300 dpi. I want to convert this to a jpeg file of approximately 20000*20000 pixels. I admit this is huge.

I let the convert statement run for 8 hours and then I hit <ctrl>+c. The cpu was nearly idle and the hard disk was working like hell. So apparently I crossed the limits of imagemagick?

Any ideas of what I can do?

thanks,
stephan
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert huge pdf to jpeg -> ultraslow performacne

Post by fmw42 »

perhaps see http://www.imagemagick.org/Usage/files/#massive as you may be running out out memory
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert huge pdf to jpeg -> ultraslow performacne

Post by magick »

Try converting the first page:
  • convert 'image.pdf[0]' image.jpg
stephan0h
Posts: 4
Joined: 2011-10-30T13:16:12-07:00
Authentication code: 8675308

Re: convert huge pdf to jpeg -> ultraslow performacne

Post by stephan0h »

magick wrote:Try converting the first page:
  • convert 'image.pdf[0]' image.jpg
Thanks for the hint - but this pdf consists only of one page ;-)
stephan0h
Posts: 4
Joined: 2011-10-30T13:16:12-07:00
Authentication code: 8675308

Re: convert huge pdf to jpeg -> ultraslow performacne

Post by stephan0h »

fmw42 wrote:perhaps see http://www.imagemagick.org/Usage/files/#massive as you may be running out out memory
Thanks for pointing me there. I was now successful using:

Code: Select all

convert -limit area 8192 -limit memory 8192 -density 300 khm6.pdf khm6.jpg
It finished in less than 10 minutes! Great!

I also tried the stream-command like:

Code: Select all

stream -density 300 khm6.pdf khm6.jpg
This also worked fast - but the resulting files where not readable. Why is that?

thanks,
stephan
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert huge pdf to jpeg -> ultraslow performacne

Post by anthony »

stephan0h wrote: I also tried the stream-command like:

Code: Select all

stream -density 300 khm6.pdf khm6.jpg
This also worked fast - but the resulting files where not readable. Why is that?
Stream only outputs raw RGB data. You need to pipe that into a convert command with the right size information to convert back to a more normal image file format.

Stream is typically used to extract a portion (crop) of the input image which is then processed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
stephan0h
Posts: 4
Joined: 2011-10-30T13:16:12-07:00
Authentication code: 8675308

Re: convert huge pdf to jpeg -> ultraslow performacne

Post by stephan0h »

thanks for clearifying!
regards,
stephan
Post Reply