Page 1 of 1

Select an image group

Posted: 2010-10-09T08:52:08-07:00
by quaid
Hi all !

I 've got image01.jpg , image02.jpg , image03.jpg... image50.jpg in the same directory.
I know that

Code: Select all

montage -verbose image01.jpg image02.jpg etc image10.jpg -mode Concatenate -tile x1 image_out.jpg 
works, but how do I can pass only the first 10 images to montage command... like a range [1-10] ?

Thanks.

Re: Select an image group

Posted: 2010-10-09T09:56:56-07:00
by fmw42
I have never tried this but see http://www.imagemagick.org/script/comma ... essing.php under Filename References

Consider the filename image-%d.jpg[1-5]. The command

convert image-%d.jpg[1-5]

causes ImageMagick to attempt to read images with these filenames:

image-1.jpg
image-2.jpg
image-3.jpg
image-4.jpg
image-5.jpg


So you should be able to do something similar with your image%2d.jpg[1-10]

Re: Select an image group

Posted: 2010-10-09T10:10:37-07:00
by quaid
the command

Code: Select all

montage 'd:\t\*%d.jpg[1-10]' -mode Concatenate -tile x1 out.jpg
montage: missing an image filename `out.jpg' @ error/montage.c/MontageImageCommand/1723.

Re: Select an image group

Posted: 2010-10-09T10:58:03-07:00
by fmw42
I don't know that you can mix * with %2d I am not that much of an expert. Try it using convert. It may not work in montage as that is older.

convert image%2d.jpg[1-10] result.gif

should make a 10 frame gif if it works. If that works then try image%2d.jpg[1-10] in montage.

Also perhaps without the quotes.

Re: Select an image group

Posted: 2010-10-09T11:14:22-07:00
by fmw42
this does not seems to work and single or double quotes does not help.

convert rose: rose01.jpg
convert rose: rose02.jpg
convert rose: rose03.jpg
convert rose: rose04.jpg
convert rose: rose05.jpg

convert rose%2d.jpg[1-3] rose.gif

but this works

convert rose: rose1.jpg
convert rose: rose2.jpg
convert rose: rose3.jpg
convert rose: rose4.jpg
convert rose: rose5.jpg

convert rose%d.jpg[1-3] rose.gif

identify rose.gif
rose.gif[0] GIF 70x46 70x46+0+0 8-bit PseudoClass 256c 11.3KB 0.000u 0:00.000
rose.gif[1] GIF 70x46 70x46+0+0 8-bit PseudoClass 256c 11.3KB 0.000u 0:00.009
rose.gif[2] GIF 70x46 70x46+0+0 8-bit PseudoClass 256c 11.3KB 0.000u 0:00.009


I am not enough of an expert to know why %d works but %2d does not.


See posts below for corrections

Re: Select an image group

Posted: 2010-10-09T11:40:36-07:00
by el_supremo
this does not seems to work and single or double quotes does not help.

convert rose: rose01.jpg
convert rose: rose02.jpg
convert rose: rose03.jpg
convert rose: rose04.jpg
convert rose: rose05.jpg

convert rose%2d.jpg[1-3] rose.gif
%2d will match the sequence 1, 2, 3, ... 9,10,11,12 etc., so there's nothing in the wildcard which will match the zero in the name.
Use:

Code: Select all

convert rose%02d.jpg[1-3] rose.gif
The %02d format matches two-digit numbers with a leading zero for those numbers less than ten, 01, 02 ,03,...,09,10,11, etc.

Pete

Re: Select an image group

Posted: 2010-10-09T11:43:54-07:00
by fmw42
Thanks Pete.

I just figured that out and was about the correct my post above.

This works.


convert rose: rose01.jpg
convert rose: rose02.jpg
convert rose: rose03.jpg
convert rose: rose04.jpg


convert rose%02d.jpg[1-3] rose2.gif

identify rose2.gif
rose2.gif[0] GIF 70x46 70x46+0+0 8-bit PseudoClass 256c 11.3KB 0.000u 0:00.009
rose2.gif[1] GIF 70x46 70x46+0+0 8-bit PseudoClass 256c 11.3KB 0.000u 0:00.009
rose2.gif[2] GIF 70x46 70x46+0+0 8-bit PseudoClass 256c 11.3KB 0.000u 0:00.000

Re: Select an image group

Posted: 2010-10-11T11:37:41-07:00
by quaid
Yes ! Now it works:

Code: Select all

montage -verbose image01.jpg image02.jpg .[ ]. image10.jpg -mode Concatenate -tile x1 image_out.jpg 
is equivalent to

Code: Select all

montage -verbose image%2d.jpg[1-10] -mode Concatenate -tile x1 image_out.jpg 
thanks for help !

Re: Select an image group

Posted: 2010-10-11T14:49:46-07:00
by fmw42
If you have leading zeros, then I believe you need

montage -verbose image%02d.jpg[1-10] -mode Concatenate -tile x1 image_out.jpg

Re: Select an image group

Posted: 2010-10-13T09:34:22-07:00
by quaid
of course... I wrote without "0"... my mistake.

Code: Select all

montage -verbose image01.jpg image02.jpg .[ ]. image10.jpg -mode Concatenate -tile x1 image_out.jpg 
equals to:

Code: Select all

montage -verbose image%02d.jpg[1-10] -mode Concatenate -tile x1 image_out.jpg