Convert of big (60MB) JPG file - performance problem

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
basstradamus
Posts: 3
Joined: 2010-02-11T07:54:13-07:00
Authentication code: 8675309

Convert of big (60MB) JPG file - performance problem

Post by basstradamus »

I have timing issue. When I try to conver quite big jpg file 60-100 MB to small gif it takes around 50 sec. Morover when the same command is runned from PHP the it takes around 5 minutes! Morover CPU usage is 100% which completelly kills web server.
My question is is there any way to do this faster? Actually I generate preview so it doesn't have to be in very good quality. But it need to be generated fast 3-4 sec.

Here is the command which I use

time convert "Test.jpg" -units PixelsPerInch -density 72 -quality 60 -resize 200 "output.gif"

real 0m48.356s
user 0m32.182s
sys 0m11.110s
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert of big (60MB) JPG file - performance problem

Post by Bonzo »

Try adding a jpg hint before reading the image:

Code: Select all

convert -size 200x200 "Test.jpg" -units PixelsPerInch -density 72 -quality 60 -resize 200 "output.gif"
Depending how new your IM version is there is a new method of writing this but I can not remember what it is !
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert of big (60MB) JPG file - performance problem

Post by fmw42 »

newer method is

-define jpeg:size=200x200 which replaces -size 200x200 as the jpeg hint

see http://www.imagemagick.org/Usage/formats/#jpg_read
Post Reply