Page 1 of 1
Appending Images from Left to Right
Posted: 2019-02-11T15:36:29-07:00
by ashfaq1987
Hello,
I am trying to append few images using the below code.
convert image_[1-$#].png -append Page1.png [$# value in the case I am using right now is 5]
But the layout of my result image looks like : image_5<-- image_4 <-- image_3<-- image_2<-- image_1
whereas I want : image_1-->image_2-->image_3-->image_4-->image_5
what am I doing wrong? Why is the layout right to left instead of left to right?
Any ideas?
Version : ImageMagick 6.6.5-8 2011-02-14
Thanks
Ash
Re: Appending Images from Left to Right
Posted: 2019-02-11T16:13:50-07:00
by fmw42
Code: Select all
convert image_[1-5].png -append Page1.png
Does that work properly? If not then your OS may be listing them by date or reverse date rather than alphabetically. If you have more than 9, then you should use leading zeroes if listed alphabetically.
If you want them all, then a better syntax would be to use Imagemagick image sequence numbering.
Code: Select all
convert image_?.png[0--1] -append Page1.png
Image sequence numbers in Imagemagick start with [0]. So if your first images is image_1.png, then that will be what is included. If your first image starts with image_0.png and you only want 1 to the last (-1), then use
Code: Select all
convert image_?.png[1--1] -append Page1.png
IM 6.6.5.8 is so ancient. I recommend that you upgrade immediately. It is over 350 versions old.
Re: Appending Images from Left to Right
Posted: 2019-02-12T07:43:17-07:00
by ashfaq1987
Thanks much for your reply. It is possible that my OS is listing the files by date. I am accessing the server through a X terminal. I tried all your suggestion but in vain. My images are still combined from Right to left. It's almost like while appending the images are added to existing images left side instead of right side. I have another which I combines vertically in which the bottom image is right justified instead of left justified. Even after using gravity options. I have no admin rights to update Imagemagick.
Thanks
Ash
Re: Appending Images from Left to Right
Posted: 2019-02-12T15:18:52-07:00
by fmw42
try
Code: Select all
convert image_?.png[0--1] -reverse -append Page1.png
Re: Appending Images from Left to Right
Posted: 2019-02-12T15:22:01-07:00
by ashfaq1987
Thanks I figured out what was wrong. I was stacking them up vertically and rotating them. now I rotate before I stack them horizontally.