Problem with dividing picture into a sequence

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
VladimirKlimov
Posts: 3
Joined: 2011-06-02T09:37:37-07:00
Authentication code: 8675308
Location: city Barnaul

Problem with dividing picture into a sequence

Post by VladimirKlimov »

Some problem with dividing a single picture into a sequence of .bmp files. I use Windows XP SP3 and IM 6.7.0-2Q16 windows-dll.exe

The text of MS-DOS .bat files:

1.
divide_BMP.bat

Code: Select all

@echo off
echo Hello this is a batch file to divide BMP into a sequence 
:: Picture 4212x2808pix will be divided into a sequence of BMP files
convert example_4212x2808pix.bmp -crop 5x2808 +repage sliced\%%02d.bmp
chdir sliced
call flop.bat
2.
flop.bat

Code: Select all

@echo off
echo Hello this is a batch file for flop BMP files
FOR %%a in (*.bmp) DO mogrify %%a -flop %%a
call montage_843.bat
3.
montage_843.bat

Code: Select all

@echo off
echo Hello this is a batch file for montage of BMP sequence into single picture
montage -mode concatenate -tile 843x *.bmp joined.bmp
The final picture is bad. If I make an .avi file from the sequence by VirtualDub software and export to BMP sequence (i.e. resynthesis of BMP sequence), then the final picture is good. Why?

I shell be very appreciated for your reply.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Problem with dividing picture into a sequence

Post by glennrp »

4212 is not evenly divisible by 5 so the final image will have width=2
Also 4212/5 is more than 99 so you should be using %03d instead of %02d
in the output filename.

I don't know if either problem is causing the "bad picture" that you observed.
VladimirKlimov
Posts: 3
Joined: 2011-06-02T09:37:37-07:00
Authentication code: 8675308
Location: city Barnaul

Re: Problem with dividing picture into a sequence

Post by VladimirKlimov »

Dear glennrp,

Thank you very much for your advice!

I have used %03d instead of %02d in the output file name. As a result, the final picture became good.
It was my mistake, no bug of IM. The IM is the great tool!


Thanks!
Post Reply