Page 1 of 1

Too slow cropping large jpg file

Posted: 2011-07-08T22:28:06-07:00
by splee
I am using ImageMagick-6.7.0-Q16 and I have a Test1.jpg file which is 28800x22400pixels (800dpi, grayscale), file size 63MB.

I did a command line "convert Test1.jpg -crop 1000x1000+0+0 Test1_cropped.jpg" and it took me a long time.

My computer is Pentium Core 2 2.66GHz and has 3GB RAM, running Windows XP (x86).

Can anyone help?

Re: Too slow cropping large jpg file

Posted: 2011-07-09T10:11:07-07:00
by fmw42
use -define to set the size to read from the input for jpg only.

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

Re: Too slow cropping large jpg file

Posted: 2011-07-09T18:21:44-07:00
by anthony
The jpeg_read option is for resizing, not cropping.


The problem is that IM "convert" will read the whole image into memory first (uncompressed), and as such if there is not enough space for both it and the cropped version, it will start using disk caching which takes a lot of time.

The IM "stream" command however could be used to crop the JPEG image, and pipe that into convert so that it has a more minimal image foot print.

Really Massive Image Handling
http://www.imagemagick.org/Usage/files/#massive

Re: Too slow cropping large jpg file

Posted: 2012-07-26T20:52:47-07:00
by splee
This seems to solve the problem:
Open Regedit and Find HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\

Disable Paging Executive:
XP pages data from RAM memory to the hard drive. We can stop this happening and keep more data in RAM, resulting in better performance. Users with a large amount of RAM (256MB+) should use this setting. The setting we change to disable the 'Paging Executive', is DisablePagingExecutive. Changing the value of this key from 0 to 1 will de-activate memory paging.
splee wrote:I am using ImageMagick-6.7.0-Q16 and I have a Test1.jpg file which is 28800x22400pixels (800dpi, grayscale), file size 63MB.

I did a command line "convert Test1.jpg -crop 1000x1000+0+0 Test1_cropped.jpg" and it took me a long time.

My computer is Pentium Core 2 2.66GHz and has 3GB RAM, running Windows XP (x86).

Can anyone help?