Page 1 of 1

Composite of 2 images using wildcard

Posted: 2007-11-05T10:20:58-07:00
by Robi
Hello, I'm new to ImageMagick, but i think it's very usefull.

Here is the problem, i have multiple images video_*.png and keyboard_*.png
where * is a 6 digits number (starting from 000000)
Basically i want to put each keyboard_*.png (small image) inside video_*.png at position +107+429
The result would for example be called result_*.png

Here is what i found :
convert C:\...\video_000000.png -page +107+429 C:\...\keybo_000000.png -flatten C:\...\result_000000.png
composite -geometry +107+429 C:\...\keybo_000000.png C:\...\video_000000.png C:\...\result_000000.png
Those two methods works but only for one composition at a time :'(

I tried that :
convert C:\...\video_*.png -page +107+429 C:\...\keybo_*.png -flatten C:\...\result_%06d.png
composite -geometry +107+429 C:\...\keybo_*.png C:\...\video_*.png C:\...\result_%06d.png

The first only do the result for the last image, for some reason.
The second only copy the keyboard image, once.

Any help will be greatly appreciated, thanks !

Re: Composite of 2 images using wildcard

Posted: 2007-11-12T10:16:06-07:00
by Robi
UP,
I still have the problem :'(
Nobody knows, really ?

Re: Composite of 2 images using wildcard

Posted: 2007-11-13T15:24:51-07:00
by Robi
Ok, i made a batch file, here is for people that might have the same problem, I use :

mkdir result
for %%f in (*.png) do P:\ImageMagick-6.3.6-Q16\composite -geometry +107+429 C:\...\keybo\%%f C:\...\%%f C:\...\result\%%f

Enjoy!

Re: Composite of 2 images using wildcard

Posted: 2007-11-19T18:54:24-07:00
by anthony
As you have the images and video separated into frames. a batch process is probably your best bet.

Some methods of batch processing are listed in
http://imagemagick.org/Usage/basics/#mogrify_not

Also another method for animations is at
http://imagemagick.org/Usage/anim_mods/#append

You can do this without using files from API's but you will need a LOT of memory to hold the whole video if you want to use that technique.