سؤال

لدي الأوامر التالية التي تنشئ العفريت التي تحتوي على حالة عادية ولاية تحوم:

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 و Somow.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

(هذا يسمي "استبدال العملية")

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top