当前位置:网站首页>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
边栏推荐
- [forward] how to view UserData in Lua
- Empty test suite appears in JUnit test
- August 30, 2020: naked write algorithm: the nearest common ancestor of two nodes in a binary tree.
- Nonvolatile MRAM memory used in all levels of cache
- Exclusive interview of guests at | 2020 PostgreSQL Asia Conference: Wang Tao
- win7 APPCRASH(解决方法)(转)
- Unexpected element.. required element
- [elastic search engine]
- 2020-08-30:裸写算法:二叉树两个节点的最近公共祖先。
- Summary of front-end interview questions (C, s, s) that front-end engineers need to understand (2)
猜你喜欢

Nonvolatile MRAM memory used in all levels of cache

Jenkins installation and deployment process

2020-08-17: how to solve data skew in detail?

2020-08-14:数据任务的执行引擎用的哪些?

C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)

A good thing for working people -- to temper the will of iron and steel requires such an efficient computer
![[elastic search engine]](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[elastic search engine]

An article taught you to download cool dog music using Python web crawler
![[doodling the footprints of Internet of things] Introduction to Internet of things](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[doodling the footprints of Internet of things] Introduction to Internet of things

应用层软件开发教父教你如何重构,资深程序员必备专业技能
随机推荐
Google browser realizes video playback acceleration function
[forward] how to view UserData in Lua
Countdown | 2020 PostgreSQL Asia Conference - agenda arrangement of Chinese sub Forum
Method of code refactoring -- Analysis of method refactoring
The memorandum model of behavior model
This project allows you to quickly learn about a programming language in a few minutes
2020-08-30:裸写算法:二叉树两个节点的最近公共祖先。
ES6 learning notes (2): teach you to play with class inheritance and class objects
Summary of front-end interview questions (C, s, s) that front-end engineers need to understand (2)
2020年新规,微信封号怎么快速解除?
Stickinengine architecture 12 communication protocol
Windows 10 蓝牙管理页面'添加蓝牙或其他设备'选项点击无响应的解决方案
Interviewer: how about shardingsphere
September 3, 2020: naked writing algorithm: loop matrix traversal.
迅为-iMX6ULL开发板上配置AP热点
August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
What kind of music do you need to make for a complete game?
What the hell is fastthreadlocal? The existence of ThreadLocal!!
2020-08-20: the difference between go and python?
Erd-online free online database modeling tool