在Imagemagick中生成日期戳图像 [英] Generating date stamp image in Imagemagick

查看:146
本文介绍了在Imagemagick中生成日期戳图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个静态html网站,我发布日历活动。我想过使用Imagemagick生成这样的日期戳图像。

I have a static html site where I post calendar events. I thought of using Imagemagick to generate date stamp image like this.

可以在ImageMagick中完成吗?

Can it be done in ImageMagick?

推荐答案

假设图像a.png包含背景(带红色条带的白色矩形),您可以使用:

Assuming that image a.png contains the background (white rectangle with red band) you can use:

convert a.png -gravity Center -pointsize 24 -annotate +0+0 "16" -gravity North -fill white -pointsize 18 -annotate +0+0 "FEB" output.png

您可能需要调整+ 0 + 0坐标以正确拟合您的背景图像。

另请注意,这是一个静态命令生成您发布的示例(月份固定为FEB,日期固定为16)。

You'll probably have to tweak +0+0 coordinates to correctly fit your background image.
Also note that this is a static command that generates the example you posted (with month fixed to 'FEB' and day fixed to '16').

这篇关于在Imagemagick中生成日期戳图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆