Convert Exceeds Memory Limits

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
hanky
Posts: 1
Joined: 2016-06-22T08:03:22-07:00
Authentication code: 1151

Convert Exceeds Memory Limits

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Exceeds Memory Limits

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply