当前位置:网站首页>ImageMagick - 添加水印
ImageMagick - 添加水印
2020-11-06 22:22:00 【wffger】
背景
最近制作思维导图想添加自己的水印,网上很多例子都是使用ImageMagick来完成。但是不少代码在本地并不可行。经过一番试验,找到两个方法。
方法一
代码
convert 'ISO_IEC 25010.jpg' \
\( \
-size 60x60 xc:none \
-fill grey \
-gravity center \
-draw "text 0,0 'wffger'" -rotate -30 -write mpr:wm \
+delete \
+clone -fill mpr:wm -draw 'color 0,0 reset' \
\) \
-compose Multiply \
-composite \
'ISO_IEC 25010-mark1.jpg'
说明
- -size,控制大小,间接设置水印间距。
- xc:none,设置水印没有背景色,xc为"X Constant Image"。
- -fill,设置水印字体颜色,不能设置成白色,否则被-compose Multiply设置成透明
方法二
代码
ImageMagick官方水印指南:
convert -size 600x600 xc:none -fill grey \
-gravity NorthWest -draw "text 10,10 'wffger'" \
-gravity SouthEast -draw "text 5,15 'wffger'" \
miff:- |\
composite -tile - 'ISO_IEC 25010.jpg' 'ISO_IEC 25010-mark2.jpg'
说明
- -size,设置水印图像大小。
- -tile,把水印平铺。
环境
ydx@ydx-mf:~/文档 $ uname -a
Linux ydx-mf 5.7.11-200.fc32.x86_64 #1 SMP Wed Jul 29 17:15:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
ydx@ydx-mf:~/文档 $ rpm -qi ImageMagick
Name : ImageMagick
Epoch : 1
Version : 6.9.11.22
Release : 1.fc32
Architecture: x86_64
版权声明
本文为[wffger]所创,转载请带上原文链接,感谢
https://my.oschina.net/wffger/blog/4489784
边栏推荐
- An article will introduce you to HTML tables and their main attributes
- Nodejs中使用jsonwebtoken(JWT)生成token的场景使用
- 打工人好物——磨炼钢铁意志就要这样高效的电脑
- Common mathematical basic formulas of recursive and backtracking algorithms
- Can you do it with only six characters?
- 2020-09-04:函数调用约定了解么?
- 2020-09-04: do you understand the function call convention?
- 2020-09-03:裸写算法:回形矩阵遍历。
- August 14, 2020: what are the execution engines for data tasks?
- window系统 本机查找端口号占用方法
猜你喜欢

Common syntax corresponding table of mongodb and SQL

Using an example to understand the underlying processing mechanism of JS function

2020-08-24:什么是小文件?很多小文件会有什么问题?很多小文件怎么解决?(大数据)

STM32F030C6T6兼容替换MM32SPIN05PF

Jenkins installation and deployment process

Windows 10 蓝牙管理页面'添加蓝牙或其他设备'选项点击无响应的解决方案

Utility class functions (continuous update)

汽车维修app开发的好处与功能

Composition of MRAM cache

Google browser realizes video playback acceleration function
随机推荐
The isolation level of transaction and its problems
mongo 用户权限 登录指令
August 30, 2020: naked write algorithm: the nearest common ancestor of two nodes in a binary tree.
Event monitoring problem
How to prepare for the system design interview
迅为iMX6开发板-设备树内核-menuconfig的使用
Git remote library rollback specified version
2020-08-30:裸写算法:二叉树两个节点的最近公共祖先。
Erd-online free online database modeling tool
Junit测试出现 empty test suite
Application insights application insights use application maps to build request link views
To solve the problem that the data interface is not updated after WPF binding set
Es create a new index database and copy the old index library, practice pro test effective!
An article will introduce you to HTML tables and their main attributes
[learning] interface test case writing and testing concerns
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
Can you do it with only six characters?
How to make characters move
Countdown | 2020 PostgreSQL Asia Conference - agenda arrangement of Chinese sub Forum
Message queue - Analysis