ImageMagick and Piping

I have the following commands that create a sprite containing a normal state and a freeze state:

convert -background none -pointsize 11 -fill white -size 100x -gravity NorthWest caption:'Test' top.png
convert -background none -pointsize 11 -fill grey -size 100x -gravity SouthWest caption:'Test' bottom.png
montage top.png bottom.png -geometry +0+0 -tile 1x2 -background none test.png

I create two images, top.png and bottom.png, then combine them to create test.png.

Is there a way to do this without writing the top and bottom images to disk?

Can I combine teams together?

Update: Solution

montage \
  <(convert -background none -pointsize 11 -fill white -size 100x -gravity NorthWest caption:'Test' png:-) \
  <(convert -background none -pointsize 11 -fill grey -size 100x -gravity SouthWest caption:'Test' png:-) \
  -geometry +0+0 -tile 1x2 -background none test.png
+3
source share
1 answer

This is completely untested, so be sure to back up the corresponding images before testing:

montage \
  <(convert -background none -pointsize 11 -fill white -size 100x -gravity NorthWest caption:'Test' png:-) \
  <(convert -background none -pointsize 11 -fill grey -size 100x -gravity SouthWest caption:'Test' png:-) \
  -geometry +0+0 -tile 1x2 -background none test.png

(This is called the Process Replacement ")

+4
source

Source: https://habr.com/ru/post/1713149/


All Articles