I have multiple images distributed along different directories.
Each folder has different number of headers and side panels. For this reason, the workaround is to execute montage function from imagemagick software with specific arguments for each temporal composed image.
Here a simple example:
cd /home/archy && montage figure1/*.png -tile 2x -geometry +1+1 figure1.png
cd /home/archy && montage figure2/*.png -tile 1x -geometry +1+1 figure2.png
See that first temporal image is a composition of two columns of images. On the other hand, the second temporal image is a composition of one column of images. Finally, I need a final image composed by this two temporal images previously created.
cd /home/archy && montage *.png -tile 1x -geometry +1+1 total.png
In the real situation, I have to create a big amount of temporal images to only create the final one. It would be great to avoid this workaround to save calculus time and system storage.
Is it posible to combine this three commands to an unique one? Thanks
It's not that clear to me where all your files are, but I think I can assist you. Rather than writing to a disk file, you can make any ImageMagick command write to a MIFF ("Magick Image File Format") stream that will preserve all information that you might otherwise have written to a file.
So, you can do this without writing to disk:
montage SOMESTUFF SOMEHOW miff:- | convert miff:- OTHERSTUFF result.png
In your specific case, I think you want:
cd /home/archy
{
montage figure1/*.png -tile 2x -geometry +1+1 miff:-
montage figure2/*.png -tile 1x -geometry +1+1 miff:-
} | montage miff:- -tile 1x -geometry +1+1 result.png
So, you are running your first montage
the same as it ever was and writing that, followed by the result of your second montage
in one compound statement, into a third montage
command that receives the first two montage
outputs and montages them into a final result!!!
I know what I mean, even if no-one else does!
By the way, if you want to run it as a one-liner, you will need an additional semi-colon before the closing brace and always a space either side of both braces:
{ montage figure1/*.png -tile 2x -geometry +1+1 miff:- ; montage figure2/*.png -tile 1x -geometry +1+1 miff:- ; } | montage miff:- -tile 1x -geometry +1+1 result.png