ImageMagick:使用带有重心的 Convert-composite 分层图像

发布于 2024-12-29 02:41:45 字数 805 浏览 4 评论 0原文

在此处输入图像描述

背景

https://i.sstatic.net/wA2EL.png

叠加

composite -gravity center overlay.png  background.jpg  result1.jpg

https://i.sstatic.net/XgdA2.jpg

结果1.jpg

convert -composite background.jpg overlay.png -gravity center result2.jpg

结果2.jpg

convert -composite background.jpg -gravity center tool_marker.png  result3.jpg

result3.jpg

当使用 Convert 作为可执行文件而不是复合文件时,如何获得 result1 的结果?

谢谢!

enter image description here

background

https://i.sstatic.net/wA2EL.png

overlay

composite -gravity center overlay.png  background.jpg  result1.jpg

https://i.sstatic.net/XgdA2.jpg

result1.jpg

convert -composite background.jpg overlay.png -gravity center result2.jpg

result2.jpg

convert -composite background.jpg -gravity center tool_marker.png  result3.jpg

result3.jpg

How can I achieve the results from result1 while using convert as the executable rather than composite?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

も让我眼熟你 2025-01-05 02:41:45

您可以按照正确的顺序使用运算符开始。那就是首先设置“设置”。
“复合”命令是“读取所有设置然后应用一个操作,命令类型(传统 UNIX)”
“转换”是“按照您所看到的方式执行选项”,可以进行多种操作。 (类似脚本的命令)

convert  background.jpg  tool_marker.png -geometry +50+50 -composite result4.jpg

请注意,+50+50 是“tool_marker.png”图像左上角的位置。您需要减去该图像中的“固定点”位置才能将其固定点在正确的位置

(如果在使用它的复合操作之前给出),对齐两个图像的中心。

convert background.jpg tool_marker.png -gravity center -composite result4.jpg

You can start by using the operators in the right order. That is set the 'settings' first.
"Composite" command is 'read all settings then apply ONE operation, type of command (traditional UNIX)
"Convert" is a 'do options as you see them', with MULTIPLE operations possible. (script-like command)

convert  background.jpg  tool_marker.png -geometry +50+50 -composite result4.jpg

Note the +50+50 is the location of the top-left corner of the 'tool_marker.png" image. You will need to subtract the 'pin-point' location in that image to get it to pin point in the right location.

Gravity Center (if given BEFORE the -composite operation that uses it), aligns the center of BOTH images.

convert background.jpg tool_marker.png -gravity center -composite result4.jpg
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文