当前位置:网站首页>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
边栏推荐
- Junit测试出现 empty test suite
- Markdown tricks
- 实用工具类函数(持续更新)
- Common mathematical basic formulas of recursive and backtracking algorithms
- Visual rolling [contrast beauty]
- 1万辆!理想汽车召回全部缺陷车:已发生事故97起,亏损将扩大
- 应用层软件开发教父教你如何重构,资深程序员必备专业技能
- All the way, I was forced to talk about C code debugging skills and remote debugging
- ES6 learning notes (2): teach you to play with class inheritance and class objects
- Characteristics of magnetic memory chip STT-MRAM
猜你喜欢
[learning] interface test case writing and testing concerns
Why is the LS command stuck when there are too many files?
How much disk space does a new empty file take?
2020 database technology conference helps technology upgrade
ES中删除索引的mapping字段时应该考虑的点
The method of local search port number occupation in Windows system
预留电池接口,内置充放电电路及电量计,迅为助力轻松搞定手持应用
Zero basis to build a web search engine of its own
Markdown tricks
An article takes you to understand CSS3 picture border
随机推荐
September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.
Stickinengine architecture 12 communication protocol
To solve the problem that the data interface is not updated after WPF binding set
Count the number of project code lines
超高频RFID医疗血液管理系统应用
Detailed software engineering -- the necessary graphs in each stage
Call analysis of start method in JNI thread and callback analysis of run method
JVM memory allocation - xms128m - xmx512m - XX: permsize = 128M - XX: maxpermsize = 512M
August 30, 2020: naked write algorithm: the nearest common ancestor of two nodes in a binary tree.
Open source a set of minimalist front and rear end separation project scaffold
Exclusive interview of guests at | 2020 PostgreSQL Asia Conference: Wang Tao
[elastic search engine]
ES中删除索引的mapping字段时应该考虑的点
Stm32f030f4p6 compatible with smart micro mm32f031f4p6
Nonvolatile MRAM memory used in all levels of cache
MRAM高速缓存的组成
What kind of music do you need to make for a complete game?
谷歌浏览器实现视频播放加速功能
细数软件工程----各阶段必不可少的那些图
Js数组-数组的用法全在这里(数组方法的重构、数组的遍历、数组的去重,数组的判断与转换)