Hi,
I'm using ImageMagick to convert some large TIFs (14000x14000) to smaller sizes - 8000x8000, 4000x4000 and 2000x2000, in GIMP and Photoshop this takes seconds but ImageMagick takes hours. My command line is:
convert "<path>\<to>\<input>" -resize 2000x2000 "<path>\<to>\<output>"
Running on a quad core Windows 7 64 box with 4GB of RAM. CPU sits at anywhere between 1% and 25% for a couple of hours before producing output.
Any ideas how to speed this up?
Thanks
Extremely slow image resize
Re: Extremely slow image resize
try the "sample" operator.
also try "Resize During Image Read" with [2000x2000] direct after the filename
http://www.imagemagick.org/Usage/resize/#sampleThe "-sample" resize operator is the fastest resize operator, especially in large scale image reduction.
also try "Resize During Image Read" with [2000x2000] direct after the filename
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Extremely slow image resize
I am no expert on this, but I believe that is because those other tools put the whole image into memory. IM has a different memory management and process in smaller parts.
see
http://www.imagemagick.org/Usage/files/#massive
see
http://www.imagemagick.org/Usage/files/#massive
Re: Extremely slow image resize
This is a strange one. I experienced the problem with the latest dynamic Q16 version but I replaced it with the Q16 static standalone version and they resize just as quickly the other tools. Seems there may be something different about the way the 2 handle large files?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Extremely slow image resize
Do you have multiple processors? If so, you can try compiling without openmp. I am not sure if that is available on Window IM. But you can check from convert -version and it will say if OpenMP is there. Otherwise, I am at a loss and you will need to get a response from the IM developers.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Extremely slow image resize
Extremely slow is caused by ImageMagick reaching memory limits (which may be settable), and as a result offloading the image processing to disk. Using a Q8 version of IM will make it much faster as it will use half the memory as a Q16. Presumably you get some othe rreduction in memory from using the other version of IM (or perhaps memory limits are set different)
An alternative is to unlimit the memory limit and allow the machine to do 'swapping' itself as needed.
But a swapping machine can be just as slow!
An alternative is to unlimit the memory limit and allow the machine to do 'swapping' itself as needed.
But a swapping machine can be just as slow!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/