Putting serval pictures in a pipe and merge them with a background
Posted: 2017-09-06T14:36:57-07:00
Dear ImageMagick community,
I started semi-automated command line editing for a small project a couple of weeks ago and got stuck during usage of pipes / virtual files.
The goal is to pick some jpg-Files from a directory, rotate and move them next to each other and merge them with the background. By using tmp png Files to enable transparency and sticking them together to a backgropund everything works fine:
Transform and rotate:
Glue together:
For better IO-perfomance I want to skip the png part by using a pipe (and Miff-files):
Unfortunately this only works for one input File 1.jpg. As soon as I add 2.jpg things stop to work as expected. After reading and trying a dozen examples including diffrent delimiters between the commands of 1.jpg and 2.jpg like ;| or using composite or montage to stick the pictures to the background I still have no solution. I even tried using brackets during conversion of the jpegs and diffrent alignments of the image manipulations.
Can you please help me to finish my performance optimization. Probably I'm not familiar with piping or using correct syntax for stdin and stdout but I couldn't find any working example.
Thank you
I started semi-automated command line editing for a small project a couple of weeks ago and got stuck during usage of pipes / virtual files.
The goal is to pick some jpg-Files from a directory, rotate and move them next to each other and merge them with the background. By using tmp png Files to enable transparency and sticking them together to a backgropund everything works fine:
Transform and rotate:
Code: Select all
convert 1.jpg -resize 50% -background none -rotate 1.png
Code: Select all
convert background.jpg -page +5+10 1.png -page +2100+10 2.png -background none -layers flatten output.jpg
Code: Select all
convert -page +5+10 -resize 40% -background none -rotate -4 1.jpg MIFF:-; \
-page +2150+10 -resize 40% -background none -rotate -4 2.jpg MIFF:- \
| convert background.jpg -background none MIFF:- -layers flatten +page +output.jpg
Can you please help me to finish my performance optimization. Probably I'm not familiar with piping or using correct syntax for stdin and stdout but I couldn't find any working example.
Thank you