ImageMagick memory usage

淺唱寂寞╮ 提交于 2019-12-05 11:01:00

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.

Try doing just a single row of 10 at a time, ten times - so you get 10 rows of 10. Then do row1 plus row2. Then rows 1&2 plus row 3.

convert 1.png 2.png 3.png ... +append row1.png
convert 11.png 12.png 13.png ... +append row2.png
...
convert 91.png 92.png 93.png ... +append row10.png

Then

convert row1.png row2.png -append row1and2.png

You can add -debug cache to your ImageMagick convert command like this:

convert -debug cache 1.png 2.png 3.png ... +append row1.png

You can also look at your resource settings as to what is available to ImageMagick like this:

identify -list resource

File         Area       Memory          Map         Disk    Thread         Time
-------------------------------------------------------------------------------
 768     1.0386GB    3.8692GiB    7.7384GiB    unlimited         4    unlimited

And increase resources like this:

convert -limit memory 32MiB ... 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!