ImageMagick slows down over time while processing a large batch of images?

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
B_Gaspar
Posts: 16
Joined: 2013-07-25T15:34:49-07:00
Authentication code: 6789

ImageMagick slows down over time while processing a large batch of images?

Post by B_Gaspar »

Hello

I don't know if this is the right place but I'm having a similar issue with Magick running in windows batch file. The batch file starts at great speed, then after about 600 images starts to slow down. I notice that the processor usage also goes down, and from my understanding its happening the same to me. Diferent computers on test same issue.

Code: Select all

 pushd \\192.168.0.191\csd01_op595_storage_b\01-MICROFILM\21_EXPORTAR\21_EXPORTAR_7750WW-21\LB0012\110_1_0081_110_1980_1980_2
   set /a counter=0
  set zero=000
  set nomeimg=0000
  setlocal ENABLEDELAYEDEXPANSION
  FOR /R %%a in (*.tif) DO (
  set /a counter=counter+1
  set countercalc=!counter!
  if /i !counter! GTR 9 set zero=00
  if /i !counter! GTR 99 set zero=0
  if /i !counter! GTR 999 set zero=
set nomeimg=!zero!!counter!

echo ------------------------------------------------------------------
echo Contador        : counter=!counter! 
 ECHO Processing file: "%%~nxa"
 ECHO Processing file: "%%~na"

magick -monitor -quiet %%a -background black -bordercolor black -border 10x10 -fuzz 40%% -trim -resample 300x300 +repage -compress lzw -format tif -compress lzw -format tif %cd:~0,2%\01-MICROFILM\30_TIF_ENTREGA\LB0012\110_1_0081_110_1980_1980_2\!nomeimg!.tif
echo %%a;!nomeimg!.tif;!DATE!;!TIME! >> %cd:~0,2%\01-MICROFILM\30_TIF_ENTREGA\LB0012\110_1_0081_110_1980_1980_2\LOG.txt
echo Imagem Processada %%a;!nomeimg!.TIF;!DATE!;!TIME!

magick -monitor -quiet %%a -background black -resample 120x120 +repage -bordercolor black -border 10x10 -deskew 80%% -fuzz 40%% -trim +repage -compress jpeg -quality 50 -format PDF %cd:~0,2%\01-MICROFILM\31_PDF_ENTREGA\LB0012\110_1_0081_110_1980_1980_2\!nomeimg!.pdf
echo %%a;!nomeimg!.tif;!DATE!;!TIME! >> %cd:~0,2%\01-MICROFILM\31_PDF_ENTREGA\LB0012\110_1_0081_110_1980_1980_2\LOG.txt
echo Imagem Processada %%a;!nomeimg!.PDF;!DATE!;!TIME!
  )
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Magick.NET slows down over time while processing a large batch of images?

Post by snibgo »

You are not using Magick.NET, so I'll move this to the Users forum.
B_Gaspar wrote:pushd \\192.168.0.191\ ...
You are accessing a network. Perhaps this is causing the slowdown. I suggest you try it locally by first copying the files from the network.

If the slowdown is consistent with using the network, use system-management tools to find the bottleneck.
snibgo's IM pages: im.snibgo.com
B_Gaspar
Posts: 16
Joined: 2013-07-25T15:34:49-07:00
Authentication code: 6789

Re: ImageMagick slows down over time while processing a large batch of images?

Post by B_Gaspar »

Thanks. A lot. That was my first idea. I will give more info after a few more tests.
Post Reply