Page 1 of 1

Convert Exceeds Memory Limits

Posted: 2016-06-22T08:10:50-07:00
by hanky
I'm using convert to transform multiple PNG images to JPG and would like to set some memory limits for this process:

Code: Select all

convert aa*png -limit area 10MB -limit memory 10MB -limit map 10MB -quality 82 pic_%03d.jpg
But using -limit option doesn't help. Convert starts to consume memory very fast and total memory consumption exceeds 2GB. How can I avoid this?

I'm using ImageMagick-6.5.4.7-7 on Centos 6.

Re: Convert Exceeds Memory Limits

Posted: 2016-06-22T08:31:03-07:00
by snibgo
"convert" reads all the images into memory before processing them. It does this because it is designed for operations that combine images in various ways. As your processing operates in each image independently, you can use "mogrify", or put "convert" into a shell "for" loop to process only one file at a time.