writeImages() uses a LOT of memory
Posted: 2010-08-28T11:30:27-07:00
Hi,
I am storing images in my own image format and converting them to magick++ for file/save operations.
When I use writeImages() on lets say 7 images, I have to store 7 times as much pixel data in memory into a STL container in order to call writeImages(). Even though magick++ is reference counted, it can't share with my image data right?
Is there any way I can reduce memory usage? Perhaps there is a smart container that can de-allocate each image as it is accessed by magick++?
I am storing images in my own image format and converting them to magick++ for file/save operations.
When I use writeImages() on lets say 7 images, I have to store 7 times as much pixel data in memory into a STL container in order to call writeImages(). Even though magick++ is reference counted, it can't share with my image data right?
Code: Select all
//Loop through myImages (a vector<myImage>) and convert all to a magick++ and store in vector
vector<Image> magickImages = ConvertToMagicks(myImages);
writeImages(magickImages.begin(), magickImages.end(), "c:/image.tif"); //so much memory being used here