Frage

Ich habe die folgenden Befehle, die einen Sprit, die einen normalen Zustand und einen Hover-Zustand zu erstellen:

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

Ich erstelle zwei Bilder, top.png und bottom.png sie dann test.png zu schaffen kombinieren.

Gibt es eine Möglichkeit, dies zu tun, ohne die obere und untere Bilder auf CD zu schreiben?

Kann ich Rohr der Befehle zusammen einige, wie?

Update: Lösung

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
War es hilfreich?

Lösung

Dies ist vollständig nicht getestet, so stellen Sie sicher, dass die entsprechenden Bilder vor dem Test-Backup:

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

(Dies wird als „ Prozess Substitution genannt „)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top