4

通常の状態とホバー状態を含むスプライトを作成する次のコマンドがあります。

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の2つの画像を作成し、それらを組み合わせて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
4

1 に答える 1

5

これは完全にテストされていないため、テストする前に関連するイメージをバックアップしてください。

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

(これは「プロセス置換」と呼ばれます)

于 2009-07-21T14:23:20.820 に答える