英文:
Combining resize+extend with composite in ImageMagick
问题
可以将以下两行命令合并为一行吗?
# 将基本图像调整大小为780x780,并将其放置在画布的南侧(1000x1000)
convert base.jpeg -resize 780x780^ -gravity south -extent 1000x1000 resized_base.jpeg
# 将label.png添加到resized_base.jepg的顶部
convert -composite -gravity north resized_base.jpeg label.png final_output.jpeg
谢谢。
英文:
Is it possible to combine the following two lines of commands into one?
# resize the base image to 780x780, and place it at the South of a canvas(1000x1000)
convert base.jpeg \
-resize 780x780^ \
-gravity south \
-extent 1000x1000 \
resized_base.jpeg
# add label.png to the top of resized_base.jepg
convert \
-composite \
-gravity north \
resized_base.jpeg label.png \
final_output.jpeg
Thanks.
答案1
得分: 2
是的,您可以在Imagemagick中组合它们。请尝试以下操作:
convert base.jpeg \
-resize 780x780^ \
-gravity south \
-extent 1000x1000 \
-gravity north \
label.png \
-composite \
final_output.jpeg
英文:
Yes, you can combine them in Imagemagick. Try the following:
convert base.jpeg \
-resize 780x780^ \
-gravity south \
-extent 1000x1000 \
-gravity north \
label.png \
-composite \
final_output.jpeg
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论