How to speed up

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
alexweb

How to speed up

Post by alexweb »

Hi

my crop command is: convert 'file_input.jpg' -crop 5075x12725+153+0! -quality '75' 'file_output.jpg'
Yeah, height is right. We have a 500mb of memory available and it take about 10 mins to complete.

Is there any ways to improve crop performance?
Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How to speed up

Post by magick »

Add -debug cache to your command line. Most likely your image pixels are cached to disk. If you add memory to your system, the pixels are processed in memory instead and the command will run in just a few seconds. You might get a speed-up by using a recent release of ImageMagick.
alexweb

Re: How to speed up

Post by alexweb »

thanks for advice!

Here is what I got:

convert -debug cache /tmp/input.jpg -crop 5075x12725+153+0! -quality '75' '/tmp/file_output.jpg'
2010-09-02T21:30:34+03:00 0:00.030 0.000u 6.6.1 Cache convert[7910]: cache.c/DestroyPixelCache/1601/Cache
destroy
2010-09-02T21:30:34+03:00 0:00.040 0.010u 6.6.1 Cache convert[7910]: cache.c/OpenPixelCache/4128/Cache
open /tmp/input.jpg[0] (heap memory, 5250x12750 510.7MiB)
2010-09-02T21:30:55+03:00 0:21.680 7.810u 6.6.1 Cache convert[7910]: cache.c/OpenPixelCache/4128/Cache
open /tmp/input.jpg[0] (heap memory, 5075x12725 492.7MiB)
Killed

I don't really care that process was killed. I made it on my laptop just for testing purposes. So how much free memory should I have to crop file in a few secs: ~500 or ~1000Mb ?

Thanks again!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How to speed up

Post by magick »

The default ImageMagick build is Q16 or 16-bits per pixels. The required memory is reduced by 1/2 for the Q8 build.

We tried your command on our system and it ran in 2GB of memory and completed in just over 3 seconds.
Post Reply