当前位置:网站首页>在已打开图片上加水印(文字)
在已打开图片上加水印(文字)
2022-08-09 12:11:00 【Newnotes】
在打开图片上加上想要的文字
from PIL import Image,ImageDraw,ImageFont
im = Image.open('1.png')
draw = ImageDraw.Draw(im)
text = "中华人民共和国888888888888"
# 设置字体、字体大小等等
font = ImageFont.truetype('simsun.ttc', 66)
# 添加水印
draw.text((150, 150), text, (255,0,0),font=font) # 在打开图片 上坐标(150,150)处开始画出红色文本
im.show()
# 保存图片
# im.save('watermark2.jpg')
边栏推荐
- 读写分离后,性能居然提升100%了呀
- 系统提供的堆 VS 手动改写堆
- 放下手机吧:实验表明花20分钟思考和上网冲浪同样快乐
- 发明时代,「幂集创新」事关你我
- [Microservice ~ Remote Call] Integrate RestTemplate, WebClient, Feign
- win10编译x264库(也有生成好的lib文件)
- AQS Synchronization Component - FutureTask Analysis and Use Cases
- API调用,API传参,面向对接开发,你真的会写接口文档吗?
- 使用RecyclerView实现三级折叠列表
- WeChat Mini Program Payment and Refund Overall Process
猜你喜欢
redis库没法引入
合并两个有序列表
Ten minutes to teach you how to use VitePress to build and deploy a personal blog site
Say goodbye to the AI era of hand looms
两分钟录音就可秒变语言通!火山语音音色复刻技术如何修炼而成?
Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?
报告:想学AI的学生数量已涨200%,老师都不够用了
Flutter Getting Started and Advanced Tour (3) Text Widgets
无重复字符的最长子串
win10编译x264库(也有生成好的lib文件)
随机推荐
Apexsqlrecover cannot connect to database
我们真的需要DApp吗?App真的不能满足我们的幻想吗?
Too much volume... Tencent was asked on the side that the memory was full, what would happen?
Programmer's Exclusive Romance - Use 3D Engine to Realize Fireworks in 5 Minutes
ThreadLocal的简单理解
用皮肤“听”音乐,网友戴上这款装备听音乐会:仿佛住在钢琴里
在“Extend the Omniverse”比赛中构建用于 3D 世界的工具
ansible-cmdb friendly display ansible collects host information
The new features of ABP 6.0.0 - rc. 1
Go Affair, How to Become a Gopher and Find a Go Job in 7 Days, Part 1
微信支付开发流程
无需精子卵子子宫体外培育胚胎,Cell论文作者这番话让网友们炸了
Flutter入门进阶之旅(五)Image Widget
已解决IndentationError: unindent does not match any oute r indentation Level
#Internet of Things essay#Xiaoxiong pie equipment development actual combat
张朝阳对话俞敏洪:一边是手推物理公式,一边是古诗信手拈来
LeetCode热题(11.合并两个有序链表)
使用注解将EventBus封装抽取到基类
FFmpeg compiles and installs on win10 (configure libx264)
世界第4疯狂的科学家,在103岁生日那天去世了