php - How to set the order of a ImageMagick montage


I want to order images not in the natural order (left-right-top-bottom) but in the order top-bottom-left-right. So when i have 8 images i want to have the first 4 in the first column and the images 5-8 in the second column.

1 5
2 6
3 7
4 8

But as in the montage usage guide i get:

1 2
3 4
5 6
7 8

I'm usingmontage -mode concatenate -tile 2x4 input_*.png output.png

I found a similar question here, but the answer to use-scene doesn't affect the result.

Another way would be to do it in two steps, so first create just the rows withmontage -mode concatenate -tile 1x{nrOfRows} input_*.png output.png and after that create the columns with the output of the previous command withmontage -mode concatenate -tile {nrOfColumns}x1 output*.png result.png.

The problem is that currently i have 1024 images and want them in 64x16 and so the output.png's becomeoutput_0.png tooutput_63.png. So when i run the second command the order is:


and so some rows are not correct.

Every hint is appreciated!

(Currently i test this via the cmd on a Windows machine but later want to have it in PHP on Linux machine)

People are also looking for solutions to the problem: php - Wordpress Media Library in plain javascript


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.