Page 1 of 1
combine multible images
Posted: 2010-04-17T08:13:36-07:00
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
Re: combine multible images
Posted: 2010-04-17T10:11:49-07:00
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?
Re: combine multible images
Posted: 2010-04-18T06:26:50-07:00
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.
Re: combine multible images
Posted: 2010-04-18T11:42:53-07:00
by fmw42
you will likely need a batch script file to loop over your images and some help from one of the Windows users.
Re: combine multible images
Posted: 2010-04-24T04:43:30-07:00
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