ImageMagick:注释图片

发布于 2024-12-01 03:33:36 字数 400 浏览 0 评论 0原文

我刚刚开始使用 ImageMagick,还不太掌握它的窍门。目前我正在使用命令行,尝试在图像上绘制一些文本。这是我正在使用的命令行:

convert "D:\Users\dcveeneman\Desktop\Pictures\Baden-Powell\Baden-Powell 001.JPG" -font Arial -pointsize 24 -fill #FFFF0000 -weight Bold -annotate 0 "2011-07-26 8:57:06" "D:\Users\dcveeneman\Desktop\temp\Baden-Powell 001.JPG"

我没有收到错误消息,但在输出图片上也没有收到任何文本。源路径和目标路径均已验证。我希望有人能指出我的命令行中的错误。预先感谢您的帮助。

I am just getting started with ImageMagick, and I don't quite have the hang of it yet. For the moment I am working with the command line, trying to draw some text on an image. Here is the comand line I am using:

convert "D:\Users\dcveeneman\Desktop\Pictures\Baden-Powell\Baden-Powell 001.JPG" -font Arial -pointsize 24 -fill #FFFF0000 -weight Bold -annotate 0 "2011-07-26 8:57:06" "D:\Users\dcveeneman\Desktop\temp\Baden-Powell 001.JPG"

I am not getting an error message, but I am not getting any text on the output picture either. Both the source and destination paths have been verified. I am hoping soeone can point out the error in my command line. Thanks in advance for your help.

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

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

发布评论

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

评论(1

一张白纸 2024-12-08 03:33:36

我找到了答案。我最基本的问题似乎是 -fill 参数。我的命令行参数是由 C# 程序生成的,该程序会迭代一个图片文件夹,并为每张图片添加时间戳。无论如何,C# 为颜色提供了 ARGB 十六进制值,而不是 ImageMagick 识别的 RGBA 值或颜色名称之一。

我还向 -annotate 参数添加了一个偏移量(+100+100,从左上角偏移。这是工作命令行:

convert "D:\Users\dcveeneman\Desktop\Pictures\Baden-Powell\Baden-Powell 001.JPG" -font Arial -pointsize 24 -fill Red -weight Bold -annotate +100+100 "2011-07-26 8:57:06" "D:\Users\dcveeneman\Desktop\temp\Baden-Powell 001.JPG"

我希望对其他人有所帮助!

I found my answer. My most fundamental problem appears to have been with the -fill parameter. My command line arguments are being generated by a C# program, which iterates a folder of pictures, time stamping each one. In any event, C# was providing an ARGB hex value for the color, instead of an RGBA value, or one of the color names, that ImageMagick recognizes.

I also added an offset to the -annotate argument (+100+100, to offset from the upper left. Here is the working command line:

convert "D:\Users\dcveeneman\Desktop\Pictures\Baden-Powell\Baden-Powell 001.JPG" -font Arial -pointsize 24 -fill Red -weight Bold -annotate +100+100 "2011-07-26 8:57:06" "D:\Users\dcveeneman\Desktop\temp\Baden-Powell 001.JPG"

I hope that helps someone else down the road!

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