当前位置:网站首页>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
边栏推荐
- Common mathematical basic formulas of recursive and backtracking algorithms
- Git remote library rollback specified version
- A good thing for working people -- to temper the will of iron and steel requires such an efficient computer
- Count the number of project code lines
- Characteristics of magnetic memory chip STT-MRAM
- What the hell is fastthreadlocal? The existence of ThreadLocal!!
- Python basic data type -- tuple analysis
- August 14, 2020: what are the execution engines for data tasks?
- The isolation level of transaction and its problems
- This project allows you to quickly learn about a programming language in a few minutes
猜你喜欢

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

win7 APPCRASH(解决方法)(转)

An article taught you to download cool dog music using Python web crawler

Zero basis to build a web search engine of its own

August 18, 2020: introduce Mr process?

2020-09-03:裸写算法:回形矩阵遍历。

An article taught you to use HTML5 SVG tags

【涂鸦物联网足迹】涂鸦云平台全景介绍

迅为-iMX6ULL开发板上配置AP热点

How to prepare for the system design interview
随机推荐
Novice guidance and event management system in game development
【涂鸦物联网足迹】涂鸦云平台全景介绍
Those who have worked in China for six years and a million annual salary want to share these four points with you
#JVM 类加载机制
This project allows you to quickly learn about a programming language in a few minutes
Elasticsearch database | elasticsearch-7.5.0 application construction
image operating system windows cannot be used on this platform
Code generator plug-in and creator preform file analysis
Unity performance optimization
消防器材RFID固定资产管理系统
实验一
Can you do it with only six characters?
An article taught you to use HTML5 SVG tags
Summary of front-end interview questions (C, s, s) that front-end engineers need to understand (2)
迅为-iMX6ULL开发板上配置AP热点
Windows 10 蓝牙管理页面'添加蓝牙或其他设备'选项点击无响应的解决方案
August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
Js字符串-String字符串对象方法
1万辆!理想汽车召回全部缺陷车:已发生事故97起,亏损将扩大
Event monitoring problem