Page 1 of 1

Saving many images to files gets slow

Posted: 2009-08-21T03:03:41-07:00
by ohach
Hey guys,

I am pretty new to IM ... I use Core functions to save buffered images to files, depending on the number of images the saving gets really slow (means < 1 MB/s). I tried two different approches:

a) creating Images and saving them via WriteFile() - gets slow at ~750 images

b) creating an Image list and saving it via WriteFiles() - the list creation almost stops at ~1200 images

All images are ~640x480 pixels, 8 bit grayscale, I guess its a memory issue, although I shouldn't touch the bounds currently. Is there a better way to save many images? Can I somehow influence the amount of allocated memory of the image list?

Any help is appreciated.
Regards, Oliver

Re: Saving many images to files gets slow

Posted: 2009-08-21T05:23:08-07:00
by anthony
Do you need to have so many images in memory at the same time.

Prehaps reading processing writing then deleting them from memory would work better.


If you use too much memory the comuter will run out and start using disk space for memory management, when is VERY VERY slow by comparision. This is known as thrashing!

Re: Saving many images to files gets slow

Posted: 2009-08-21T06:01:30-07:00
by ohach
Hi Anthony, thanks for the reply.
anthony wrote:Do you need to have so many images in memory at the same time.
Yes, since they are grabbed from a camera at 200 fps.
anthony wrote:Prehaps reading processing writing then deleting them from memory would work better.
I already tried that, freeing the buffer memory as soon as an image is written to a file. Doesn't make a difference, there is still physical memory available in any case.
anthony wrote:If you use too much memory the comuter will run out and start using disk space for memory management, when is VERY VERY slow by comparision. This is known as thrashing!
I now write the images directly using Windows file operations and the GDI+ definitions. It works quite well, even with >5000 images. I still would be interested if there would be a way to do it with Magick Core functions.

Oliver