当前位置:网站首页>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
边栏推荐
- August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
- 大佬们如何在nginx镜像里面增加模块?
- html+ vue.js Implementing paging compatible IE
- Those who have worked in China for six years and a million annual salary want to share these four points with you
- DC-1 target
- 迅为-iMX6ULL开发板上配置AP热点
- 2020-08-18:介绍下MR过程?
- 实验一
- [self taught unity2d legendary game development] map editor
- 【涂鸦物联网足迹】物联网基础介绍篇
猜你喜欢
上海巨微专用蓝牙广播芯片
List to map (split the list according to the key, and the value of the same key is a list)
2020-08-20: the difference between go and python?
Exclusive interview of guests at | 2020 PostgreSQL Asia Conference: Wang Tao
How much disk space does a new empty file take?
Elasticsearch database | elasticsearch-7.5.0 application construction
Detect certificate expiration script
心理咨询app开发所具备的优点与功能
Introduction to Huawei cloud micro certification examination
Novice guidance and event management system in game development
随机推荐
Count the number of project code lines
Those who have worked in China for six years and a million annual salary want to share these four points with you
打工人好物——磨炼钢铁意志就要这样高效的电脑
Zhou Jie: database system of East China Normal University
[elastic search engine]
The memorandum model of behavior model
[learning] interface test case writing and testing concerns
迅为iMX6开发板-设备树内核-menuconfig的使用
STM32F030K6T6兼容替换灵动MM32F031K6T6
An article taught you to download cool dog music using Python web crawler
This project allows you to quickly learn about a programming language in a few minutes
C and C / C + + mixed programming series 5 - GC collaboration of memory management
Stm32f030f4p6 compatible with smart micro mm32f031f4p6
Google browser realizes video playback acceleration function
汽车维修app开发的好处与功能
Python basic variable type -- list analysis
How to manage the authority of database account?
2020-08-19:TCP是通过什么机制保障可靠性的?
2020-08-20:GO语言中的协程与Python中的协程的区别?
The essence of transaction and the principle of deadlock