ImageMagick and CPU

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
Galajas
Posts: 3
Joined: 2019-03-25T06:25:09-07:00
Authentication code: 1152

ImageMagick and CPU

Post by Galajas »

why imagemagick don't use all CPU?
In Task Manager i see max 3% all CPU use.
Win 7 - ImageMagick-7.0.8-Q16

Code: Select all

Resource limits:
  Width: 214.748M
  Height: 214.748
  List length: -1
  Area: 8.56778GP
  Memory: 3.98968
  Map: 7.97936GiB
  Disk: unlimited
  File: 1536
  Thread: 12
  Throttle: 0
  Time: unlimited
Its posible do something, that ImageMagick use more CPU, becouse i work with big size PGM raw and TIFF images.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick and CPU

Post by snibgo »

What is your IM command?

I suppose you have 12 processors. Some IM operations (eg "-blur") will multi-thread, but some will not. In general, reading and writing files is single-threaded.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick and CPU

Post by fmw42 »

This post is not about PAID Consulting, so I have moved it from the Consulting forum to the User's forum.
Galajas
Posts: 3
Joined: 2019-03-25T06:25:09-07:00
Authentication code: 1152

Re: ImageMagick and CPU

Post by Galajas »

Hello,
I am take PDF and with GhostScript i convert in to PGMraw, and then with IM make these changes.

Code: Select all

start /wait "" "magick" "%~p1%~n1_converted.pgm" -threshold 84%% -bordercolor white -border 944x944 -negate -resize 99.75%% -density 2400 -units PixelsPerInch "%~p1%~n1_converted.tiff"
It is even possible, make IM take more CPU not just 1-5%?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick and CPU

Post by snibgo »

How large is your input, in pixels? Perhaps you don't have enough memory, so IM has to store the pixel caches on disk, so most of the time is spent reading/writing the disk, so the CPU is mostly waiting for disk.
snibgo's IM pages: im.snibgo.com
Galajas
Posts: 3
Joined: 2019-03-25T06:25:09-07:00
Authentication code: 1152

Re: ImageMagick and CPU

Post by Galajas »

my PGM one of size input is 46048 x 22612px.
Maybe i can make somewhere to unlimited all these resources?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick and CPU

Post by snibgo »

That needs about 8 GB memory just to read the image, before doing any processing. Your "-list resource" is truncated, but it seems you don't have enough memory.
snibgo's IM pages: im.snibgo.com
Post Reply