技术简记/

用 convert 命令给图片加水印

使用 convert 命令,需要先安装 imagemagick,仅适用于 Linux 和 Mac 系统。

$ brew install imagemagick

以图片加在中间为例,命令如下:

$ convert -draw 'text 0,0 "MacBook Pro"' -fill 'rgba(255,255,255, 0.35)' -pointsize 72 -gravity center -font "SF Mono Regular Nerd Font Complete.otf" macbook.png macbook_watermark.png

-gravity center 水印位置(可选 northeast, northwest, southeast, southwest)
-font 指定字体,可到网上下载字体文件。

效果图:

macbook-watermark

留下一条评论

暂无评论