Page 1 of 1

Import and Magick++

Posted: 2010-08-12T10:31:24-07:00
by slackkeymike
Hi, new here, long time fan of ImageMagick. Linux, C++, ImageMagick well versed.

I recently modified a program that would write AVI files based on synthetic imagery. I did not own the AVI module, so I had to do something else. So, I researched the IM Magick++ API and decided it could do what I needed.

What I need to be able to do is dump a series of PNG files to a subdirectory. I use another to (mplayer) to convert them into an AVI. I have accomplished all of this using the "import" command (system("import -window id filename.png"), then image.read(filename.png), then image.write(newfilename.png)). The second write is to give it a unique filename like image001,png, image002.png, etc. My "make_avi_script" uses mplayer functionality to combine all of them into an AVI.

First question: Is there a way to do import (screen grabbing) without a C++ system call? It would be great if there was some class available for this. I would also like to avoid the write associated with the import so as to keep it all in memory (faster). Oh, that write also requires a read (image.read()) to get it back for renaming before the final write. This making sense?

Second question: Is there a way to go straight to an AVI? (as opposed to storing hundreds of PNGs and then foriming into an AVI)

Thank you!!

Mike

Re: Import and Magick++

Posted: 2010-08-12T13:30:07-07:00
by slackkeymike
I will try to answer my own "newbie" question by asking another question.

Is the problem I am describing one that is better suited to MagicWand? I do most stuff in C++ so I naturally gravitated to Magick++. Is the intent here to use MagicWand in conjunction with Magick++?

Mike