Page 1 of 1

SOLVED - Random Blue Screens

Posted: 2018-04-12T15:16:04-07:00
by mdavidjohnson
I'm using ImageMagick 7.07 on Windows 7 Pro (64-bit) SP1.

I'm cropping a 27000x13500 pixel .png image into 64800 75x75 pixel .png sub-images, using a 64800-line batch file at the command prompt. Here are three representative lines from that batch file:

Magick convert M1.png -crop 75x75+26400+75 M352x001.png
Magick convert M1.png -crop 75x75+26475+75 M353x001.png
Magick convert M1.png -crop 75x75+26550+75 M354x001.png

This is working correctly and is producing the proper sub-images. However, I'm experiencing random Blue Screens (at iteration 14, 546, 598, and 707 so far). Each time it happens, I truncate the batch file and continue from the point of failure.

I don't experience this Blue Screen problem with any other programs.

When I restart the computer after the Blue Screen, I also get a popup saying that "Windows could not connect to the System Event Notification Service". But when I look at that service, it has started automatically and is running.

Any ideas?

Re: Random Blue Screens

Posted: 2018-04-12T17:02:17-07:00
by snibgo
For IM v7, I suggest you use "magick", not "magick convert".

By "Blue screen", I assume you mean Windows crashes with the "blue screen of death"?

I guess it is an out-of-memory problem. Running out of memory is not predictable, because it depends what else Windows is doing.

Your input is large. At 8 bytes/pixel, it needs 3GB of memory. How much free memory do you have?

Re-reading a large PNG file 64 thousand times is crazy. Instead, I would read it once, making a MPC file. Then use that MPC as the input. This will use less memory and be faster.

Code: Select all

magick M1.png M1.mpc
magick M1.mpc -crop 75x75+26400+75 M352x001.png
magick M1.mpc -crop 75x75+26475+75 M353x001.png
magick M1.mpc -crop 75x75+26550+75 M354x001.png
: etc
del M1.mpc
del M1.cache
Another option is to have one magick command that calls a script that reads the input once, and has each crop and write within a parenthesis.

Re: Random Blue Screens

Posted: 2018-04-13T07:30:23-07:00
by mdavidjohnson
Update: further Blue Screens at iterations 897, 941, 959, 996, 1075, 1153, and 1202.

Re: Random Blue Screens

Posted: 2018-04-13T07:34:45-07:00
by mdavidjohnson
Thanks snibgo - I'll give that a try. BTW, I have 16GB of RAM, of which 12 is available and 9 is free.

Re: Random Blue Screens

Posted: 2018-04-13T11:07:39-07:00
by mdavidjohnson
Thank you again, snibgo -

That is indeed much faster (an estimated 26-hour run vs. a previously estimated 9-day run). And, no more crashes so far (just passed iteration 2000).

I'm new to ImageMagick and to this forum. How do I mark this request as SOLVED?

Re: Random Blue Screens

Posted: 2018-04-13T11:48:44-07:00
by fmw42
mdavidjohnson wrote: 2018-04-13T11:07:39-07:00 I'm new to ImageMagick and to this forum. How do I mark this request as SOLVED?
Edit the title of your first post at the top of this topic