ImageMagick:注释图片
我刚刚开始使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了答案。我最基本的问题似乎是
-fill
参数。我的命令行参数是由 C# 程序生成的,该程序会迭代一个图片文件夹,并为每张图片添加时间戳。无论如何,C# 为颜色提供了 ARGB 十六进制值,而不是 ImageMagick 识别的 RGBA 值或颜色名称之一。我还向 -annotate 参数添加了一个偏移量(+100+100,从左上角偏移。这是工作命令行:
我希望对其他人有所帮助!
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:
I hope that helps someone else down the road!