ImageMagick7 runs much slower than version6

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

Re: ImageMagick7 runs much slower than version6

Post by fmw42 »

Correct. That is what I wrote earlier in this topic.
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: ImageMagick7 runs much slower than version6

Post by niyanwen »

the one you talk about limit thread is this below?
convert -limit thread 1 src.png -resize 4000x5000! -format %@ -write info: -trim +repage -bordercolor none -border 5 dest.png

I try this but got errors
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick7 runs much slower than version6

Post by fmw42 »

It works fine for me.

Code: Select all

convert -limit thread 1 b07s8dt2vc-large-front_image.png -resize 4500x5400! -format %@ -write info: -trim +repage -bordercolor none -border 5 result.png
3739x5194+452+57
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: ImageMagick7 runs much slower than version6

Post by niyanwen »

Hi,
does that mean HDRI has been disabled?
looks like it is still slow. do I need also disable OpenMP? if it is, do you know how to do it?

[niyanwen@mftp-ygw-i-d-2a-43520b1f]/apollo/env/MerchFTProductionAssetManagerService/bin% ./convert -version
Version: ImageMagick 7.0.8-37 Q16 x86_64 2019-10-08 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib fontconfig freetype jng jp2 jpeg lcms png raw tiff webp xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick7 runs much slower than version6

Post by fmw42 »

-limit thread 1 just disable your 16 processors and forces Imagemagick to use just 1. It has nothing to do with HDRI. To disable HDRI or OpenMP, you have to recompile ImageMagick. I doubt disabling OpenMP will make a difference since -limit thread 1 did not seem to help.
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: ImageMagick7 runs much slower than version6

Post by niyanwen »

oh I haven't try limit 1 yet, now I just tried disable HDR I found in some posts says it will help, I saw another suggestion is try add -quality 21?
https://www.imagemagick.org/discourse-s ... hp?t=27672
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: ImageMagick7 runs much slower than version6

Post by niyanwen »

looks like limit thread helps and speed improve a lot!
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: ImageMagick7 runs much slower than version6

Post by niyanwen »

fmw42 wrote: 2019-10-08T16:44:23-07:00 -limit thread 1 just disable your 16 processors and forces Imagemagick to use just 1. It has nothing to do with HDRI. To disable HDRI or OpenMP, you have to recompile ImageMagick. I doubt disabling OpenMP will make a difference since -limit thread 1 did not seem to help.
just one concern is what do you mean disable 16 processors and force to just use 1?
for if this host has another image magick command running, is it acceptable?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick7 runs much slower than version6

Post by fmw42 »

It only disables the other processors for the command for which -limit is set, not for the server. But that did not help, so no point in doing -limit. However, if your hosting provided disables OpenMP or HDRI, that would affect the whole server and all users. So that is not likely going to happen if you are on a shared server.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick7 runs much slower than version6

Post by snibgo »

Multi-threading can be disabled per command, but HDRI is a build-level switch.

I use at least two versions of IM: HDRI when I need precision, and non-HDRI when I need speed. This may not be feasible on a shared server.
snibgo's IM pages: im.snibgo.com
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: ImageMagick7 runs much slower than version6

Post by niyanwen »

limit thread help, so now I am doing 1. limit 2. disable HDR 3. add quality to improve the speed, thank you guys!
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: ImageMagick7 runs much slower than version6

Post by niyanwen »

IM6 is limit thread 1 by default?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick7 runs much slower than version6

Post by snibgo »

niyanwen wrote:IM6 is limit thread 1 by default?
No. "convert -list resource" shows the limit:

Code: Select all

Resource limits:
  Width: 214.7MP
  Height: 214.7MP
  List length: 18.446744EP
  Area: 6.4068GP
  Memory: 2.9834GiB
  Map: 5.9668GiB
  Disk: unlimited
  File: 1536
  Thread: 8  <<========
  Throttle: 0
  Time: unlimited
On my computer, the limit is 8.
snibgo's IM pages: im.snibgo.com
Post Reply