Composite of 2 images using wildcard

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
Robi

Composite of 2 images using wildcard

Post 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 !
Robi

Re: Composite of 2 images using wildcard

Post by Robi »

UP,
I still have the problem :'(
Nobody knows, really ?
Robi

Re: Composite of 2 images using wildcard

Post 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!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Composite of 2 images using wildcard

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply