Page 1 of 1

Resizing became very slow after last upgrade

Posted: 2014-10-21T19:44:09-07:00
by konstantin
I am using Arch Linux, and after the last upgrade the resizing with mogrify / convert became extremly slow: more than 10 seconds/image (720x540=>266x192). Before it was quick enough, a few seconds per / 70 images. What can I do to make it work faster again?

Re: Resizing became very slow after last upgrade

Posted: 2014-10-21T20:08:45-07:00
by fmw42
Not enough information.

What do you get from

convert -version

Do you have OpenMP or OpenCV installed? Are you using Q16, Q8 or HDRI?

Does your image have large amounts of meta data such as large profiles?

Can you post a link to your image?

What input format? What output format? Any compression?

If I run this it returns very fast for this 640x480 image on my Mac Mini running 1 thread and IM 6.8.9.8 Q16?

Code: Select all

time convert logo: -resize 266x192 tmp.jpg
real 0m0.441s
user 0m0.042s
sys 0m0.014s


What times do you get from this same command?

Re: Resizing became very slow after last upgrade

Posted: 2014-10-21T20:26:24-07:00
by konstantin
On my VPS:

Code: Select all

time convert logo: -resize 266x192 tmp.jpg
real 0m15.258s
user 0m14.197s
sys 0m0.893s

On my home machine:

Code: Select all

 time convert logo: -resize 266x192 tmp.jpg
real 0m45.332s
user 0m47.323s
sys 0m2.580s

Re: Resizing became very slow after last upgrade

Posted: 2014-10-21T20:33:34-07:00
by konstantin

Code: Select all

convert -version
Version: ImageMagick 6.8.9-8 Q16 i686 2014-10-09 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC HDRI Modules OpenCL OpenMP
Delegates: bzlib cairo fontconfig freetype gslib jng jp2 jpeg lcms lqr ltdl lzma pangocairo png ps rsvg tiff webp wmf x xml zlib
My images are simple video screenshots, 720x540, 640x480 resolution. Simple jpg images, no metadata, they were extracted from videos by ffmpeg with quality "2".

My input format is .jpg, output format is plain .bmp (for faster processing).

Re: Resizing became very slow after last upgrade

Posted: 2014-10-21T21:04:05-07:00
by fmw42
try compiling without OpenMP and without HDRI and see if that helps. I have heard that onn some Unix systems OpenMP can cause a slowdown.

Are you sure that your input image has no profiles? What do you get from identify -verbose on your input file? Are you running an old version of libjpeg? Quality 2 is very low, though I would not expect that to be a problem. Try having ffmpeg output a larger quality. Are you extracting frames from ffmpeg or doing a screen capture while running the video?

Re: Resizing became very slow after last upgrade

Posted: 2014-10-21T21:52:24-07:00
by konstantin
If I compile from source with option:

Code: Select all

./configure --disable-openmp
Resizing works quick again. However command "montage" refuse to work.

Re: Resizing became very slow after last upgrade

Posted: 2014-10-21T21:54:39-07:00
by konstantin
fmw42 wrote:try compiling without OpenMP and without HDRI and see if that helps. I have heard that onn some Unix systems OpenMP can cause a slowdown.

Are you sure that your input image has no profiles? What do you get from identify -verbose on your input file? Are you running an old version of libjpeg? Quality 2 is very low, though I would not expect that to be a problem. Try having ffmpeg output a larger quality. Are you extracting frames from ffmpeg or doing a screen capture while running the video?
Quality "2" refers to ffmpeg command option, and it is higher quality than 4, 8 etc. Not imagemagick quality settings, I usually use quality 96 with imagemagick.

Re: Resizing became very slow after last upgrade

Posted: 2014-10-21T22:06:49-07:00
by fmw42
Resizing works quick again. However command "montage" refuse to work.
OpenMP should have no bearing on whether montage works or not. Sounds like a bad compile. Look in the config.log file for errors.

Other than this, I am not sure I can help with getting montage to work. Try a new compile. Try doing make clean before make.

If that fails, then recompile with OpenMP enabled again and try using thread control on the command lines that are slowed down. See

viewtopic.php?f=2&t=20756&p=83407&hilit=thread#p83407

Re: Resizing became very slow after last upgrade

Posted: 2014-10-22T00:18:48-07:00
by konstantin
Thx, it works now flawlessly and quick. I had to use a few other options to ./configure, because I doesn't have X installed on my VPS. (--with-freetype=yes, --without-x)