ImageMagick的和管道
-
18-09-2019 - |
题
我有创建包含正常状态和一种悬停状态的sprite以下命令:
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
我创建两个图像,top.png和bottom.png然后将它们结合起来以创建test.png。
有一种方法来做到这一点,而无需编写的顶部和底部的图像到光盘?
我可以管的命令一起一些如何?
<强>更新:溶液强>
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
解决方案
这是完全未经检验的,所以一定要备份测试之前相关图片:
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
(这被称为“进程替换 “)
不隶属于 StackOverflow