Discussion:
[GM-help] GraphicsMagick 1.3.5 Image Size Limitations Under Windows XP?
Bob Friesenhahn
2009-02-03 17:30:06 UTC
Permalink
Here is an example of the gm command line that I am currently using
gm -convert "00000650.tif" -limit memory 1536mb -sample 2000x203771 -units PixelsPerPinch -density 400x400 -compress Group4 "new.tif"
gm convert: Image pixel limit exceeded (see -limit Pixels) (00000650.tif).
I also tried adding -limit pixels 3072MP and -limit pixels 4096 MP,
and the command still failed with the same message.
The command line is (mostly) evaluated in left to right order. Put
the -limit option right after 'convert' and the problem should go
away.

You can also set the MAGICK_LIMIT_PIXELS environment variable using a
very large value so that you don't have to specify it on the command
line. You can set it for your Windows user account.

% gm convert -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 409.6MP (MAGICK_LIMIT_PIXELS)

% gm convert -limit pixels 3072MP -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 3.0GP (MAGICK_LIMIT_PIXELS)

% export MAGICK_LIMIT_PIXELS=3072MP
% gm convert -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 3.0GP (MAGICK_LIMIT_PIXELS)

Note that for extremely wide images (which you don't have) it is
possible to run out of memory due to extremely long scanlines even if
the pixels limit is set very high.

Bob
======================================
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Kevin Myers
2009-02-03 17:19:18 UTC
Permalink
Hello Bob,

I've been using the latest GraphicsMagick release to process some large well log images, and it is generally working well. However, I have run into problems with some of the largest images. I suspect that gm is running out of memory on these images, but was hoping that it might be able to handle these larger images in some manner by swapping portions of the images to disk. Can you advise whether this should be possible, and if so, what options should be necessary on the gm command line to force the necessary behavior? Following is a list of image sizes that I am having problems with:

00000649.tif: 3000 pixels x 401568 pixels, 1 bit/sample, Group 4 compression
00000650.tif: 3000 pixels x 305656 pixels, 1 bit/sample, Group 4 compression
00000685.tif: 3000 pixels x 400984 pixels, 1 bit/sample, Group 4 compression
00000686.tif: 3000 pixels x 735068 pixels, 1 bit/sample, Group 4 compression
00000687.tif: 3000 pixels x 652236 pixels, 1 bit/sample, Group 4 compression
00000695.tif: 3000 pixels x 734108 pixels, 1 bit/sample, Group 4 compression

The following file and smaller images did NOT have a problem:
00000643.tif: 3000 pixels x 192624 pixels, 1 bit/sample, Group 4 compression
00000691.tif: 3000 pixels x 250712 pixels, 1 bit/sample, Group 4 compression
00000740.tif: 3000 pixels x 247088 pixels, 1 bit/sample, Group 4 compression
00000744.tif: 3000 pixels x 237192 pixels, 1 bit/sample, Group 4 compression

Here is an example of the gm command line that I am currently using (to resample 600 dpi image down to 400 dpi):

gm -convert "00000650.tif" -limit memory 1536mb -sample 2000x203771 -units PixelsPerPinch -density 400x400 -compress Group4 "new.tif"

Here is the error message that I get:

gm convert: Image pixel limit exceeded (see -limit Pixels) (00000650.tif).

I also tried adding -limit pixels 3072MP and -limit pixels 4096 MP, and the command still failed with the same message.

I'd appreciate any suggestions that you may have.

Thanks,
Kevin M.
Kevin Myers
2009-02-03 17:54:29 UTC
Permalink
Thanks a lot Bob! I should have figured that one out. Unfortunately,
sometimes I miss the obvious...

Regards,
Kevin M.


----- Original Message -----
From: "Bob Friesenhahn" <***@simple.dallas.tx.us>
To: "Kevin Myers" <***@clearwire.net>
Cc: "gm-help" <graphicsmagick-***@lists.sourceforge.net>; "Eric Myers"
<***@yahoo.com>
Sent: Tuesday, February 03, 2009 11:30
Subject: Re: GraphicsMagick 1.3.5 Image Size Limitations Under Windows XP?
Post by Bob Friesenhahn
Post by Kevin Myers
Here is an example of the gm command line that I am currently using (to
gm -convert "00000650.tif" -limit memory 1536mb -sample
2000x203771 -units PixelsPerPinch -density 400x400 -compress Group4
"new.tif"
gm convert: Image pixel limit exceeded (see -limit Pixels)
(00000650.tif).
I also tried adding -limit pixels 3072MP and -limit pixels 4096 MP, and
the command still failed with the same message.
The command line is (mostly) evaluated in left to right order. Put
the -limit option right after 'convert' and the problem should go away.
You can also set the MAGICK_LIMIT_PIXELS environment variable using a very
large value so that you don't have to specify it on the command line. You
can set it for your Windows user account.
% gm convert -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 409.6MP (MAGICK_LIMIT_PIXELS)
% gm convert -limit pixels 3072MP -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 3.0GP (MAGICK_LIMIT_PIXELS)
% export MAGICK_LIMIT_PIXELS=3072MP
% gm convert -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 3.0GP (MAGICK_LIMIT_PIXELS)
Note that for extremely wide images (which you don't have) it is possible
to run out of memory due to extremely long scanlines even if the pixels
limit is set very high.
Bob
======================================
Bob Friesenhahn
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Loading...