Page 1 of 1

Posted: 2006-02-16T15:50:11-07:00
by magick
ImageMagick unpacks images into separate red, green, blue, and opacity components at the depth its was built at. So even though your image is 1 bits-per-pixel, for the Q8 version it is expanded to 32 bits-per-pixel. If your image has a colormap, it requires 40 bits-per-pixel. For a 20,000 by 15,000 image that means the pixel cache requires about 1.3GB of storage. It would be easy to argue that it is quite inefficient to store 1- bit monochrome images into a 32-bit pixel but when we designed ImageMagick it was the only reasonable solution we could come up with that could handle hundreds of different image formats with tens of different image depths with many different storage formats (e.g. monochrome, colormapped, RGB, RGBA, CMYK, CMYKA, and others) and about a thousand different image-processing algorithms.

Posted: 2006-02-17T10:07:15-07:00
by magick
If the ImageMagick resource limits permit it, ImageMagick will attempt to allocate the pixel cache in memory. However, if the malloc() call fails, it writes the pixel cache to disk instead. In your case, it appears that the malloc() is failing to return the requested 1.3GB memory allocation.

Posted: 2006-03-03T08:07:24-07:00
by magick
ImageMagick reports resources with three numbers. The first is the current resource request, the second is the total resources consumed at the moment, and the last is the resource limit. In the case of the pixel cache, when the memory limit is reached, the next image is automatically cached to memory-mapped disk unless that limit is exceeded. If so, the pixels are cached to disk. If the disk limit is exceeded, ImageMagick refuses to creates the image.