Resizing became very slow after last upgrade

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
konstantin
Posts: 50
Joined: 2013-08-07T13:50:31-07:00
Authentication code: 6789

Resizing became very slow after last upgrade

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Resizing became very slow after last upgrade

Post 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?
konstantin
Posts: 50
Joined: 2013-08-07T13:50:31-07:00
Authentication code: 6789

Re: Resizing became very slow after last upgrade

Post 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
Last edited by konstantin on 2014-10-21T21:03:16-07:00, edited 1 time in total.
konstantin
Posts: 50
Joined: 2013-08-07T13:50:31-07:00
Authentication code: 6789

Re: Resizing became very slow after last upgrade

Post 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).
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Resizing became very slow after last upgrade

Post 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?
konstantin
Posts: 50
Joined: 2013-08-07T13:50:31-07:00
Authentication code: 6789

Re: Resizing became very slow after last upgrade

Post 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.
konstantin
Posts: 50
Joined: 2013-08-07T13:50:31-07:00
Authentication code: 6789

Re: Resizing became very slow after last upgrade

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Resizing became very slow after last upgrade

Post 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
konstantin
Posts: 50
Joined: 2013-08-07T13:50:31-07:00
Authentication code: 6789

Re: Resizing became very slow after last upgrade

Post 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)
Post Reply