combine multible images

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
lundsimon

combine multible images

Post by lundsimon »

I have a scanner that is generating a sequence of motion picture monochrome images of the RGB information is this order
image0.bmp red
image1.bmp green
image2.bmp blue
image3.bmp red
ect..

Is there a way with the comand line to combine a batch of these files within a range so it will start with every third image without writing out every frame number?

Thanks,

Simon
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: combine multible images

Post by fmw42 »

lundsimon wrote:I have a scanner that is generating a sequence of motion picture monochrome images of the RGB information is this order
image0.bmp red
image1.bmp green
image2.bmp blue
image3.bmp red
ect..

Is there a way with the comand line to combine a batch of these files within a range so it will start with every third image without writing out every frame number?

Thanks,

Simon

What do you mean by combine?

I suspect that you will likely need to write a script to loop over your images and select every 3rd one. What platform are you on?
lundsimon

Re: combine multible images

Post by lundsimon »

By using this command:

convert image0.bmp image1.bmp image2.bmp -channel RGB \
-combine imagecopy.bmp

I can make a color image out of the monochrome files, I am using windows XP.

S.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: combine multible images

Post by fmw42 »

you will likely need a batch script file to loop over your images and some help from one of the Windows users.
lundsimon

Re: combine multible images

Post by lundsimon »

The batch scrip was a good hint, this could be streamlined but it works. i is the first frame, title is the file name and the LEQ value is the last frame to be combined.

Thanks,

Simon


@echo off
set i=0
set title=test
set plus=1
set /a one=%i%+%plus%
set /a two=%one%+%plus%
set three=3
set count=0
set plus=1

:startloop
@echo on
convert %title%%i%.bmp %title%%one%.bmp %title%%two%.bmp -channel RGB -combine -negate %title%rgb%count%.bmp



@echo off
set /a i="%i%+%three%"
set /a one="%one%+%three%"
set /a two="%two%+%three%"
set /a count="%count%+%plus%"


if %i% LEQ 2 goto :startloop
echo done
Post Reply