ImageMagick memory usage

Selphiron picture Selphiron · Nov 9, 2014 · Viewed 8.8k times · Source

I have 100 PNG-files and each of them is 8250x4090 big. I need to append them with Imagemagick to one big PNG-file (82500 x 40900) so that I have 10 rows and 10 columns . I know how the code must look like but I get the errors: convert.exe: unable to extend cache

`C:\Row_345.png': No space left on device @ error/cache.c/OpenPixelCache/3689.
convert.exe: Memory allocation failed `C:\Row_345.png' @ error/png.c/WriteOnePNGImage/8725.

First question: How much space is needed (approximately)? I have 8 GB of Ram and 30 GB free SSD and it wasn't enough. The pictures have polygons and lines in up to 5 different colors. The biggest PNG is 300 KB) Second question: Is there a way how to make it more clever so that it won't use that much space?

Answer

Glenn Randers-Pehrson picture Glenn Randers-Pehrson · Nov 10, 2014

ImageMagick needs 8 bytes per pixel if you are using a Q16 build. A Q8 build only needs 4 bytes per pixel.

82500 * 40900 * 8 = about 27Gbytes 82500 * 40900 * 4 = about 13.5 Gbytes

The size of the PNG is irrelevant; ImageMagick stores them uncompressed.

Possibly ImageMagick is trying to hold two copies -- your 100 small images plus the large result. It may be that you'll have enough memory plus disk to run your conversion with ImageMagick-Q8.