Generating date stamp image in Imagemagick

前端 未结 3 896
心在旅途
心在旅途 2021-01-24 03:16

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

3条回答
  •  遥遥无期
    2021-01-24 04:00

    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
    

    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').

提交回复
热议问题