1 Star 0 Fork 0

Jay.Xiang/python_demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
image_draw_test3.py 765 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jay.Xiang 提交于 4年前 . pil库的学习
"""
@author: 码农飞哥
@file: image_draw_test3.py.py
@date: 2021/10/9 16:20
@desc:
"""
from PIL import Image, ImageDraw
# 画点
im = Image.new('RGB', (600, 600), 'white')
draw = ImageDraw.Draw(im)
# # 创建一个正方形,[x1,x2,y1,y2] 或者[(x1,x2),(y1,y2)],fill 代表的为颜色
# draw.line([100, 100, 100, 500], fill='blue', width=2) # 左竖线
# draw.line([100, 100, 500, 100], fill='blue', width=2) # 上横线
# draw.line([500, 100, 500, 500], 'blue', width=2) #右竖线
# draw.line([100, 500, 500, 500], 'blue', width=2) #下横线
# im.save('picture/sequare.png', 'png')
# im.show()
# 弧形 [x1,x2,y1,y2] 弧度 颜色
draw.arc([100, 100, 600, 600], 0, 360, fill='black')
draw.arc([200, 100, 500, 600], 0, 360, fill='yellow')
im.show()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/jayxiang31/python_demo.git
git@gitee.com:jayxiang31/python_demo.git
jayxiang31
python_demo
python_demo
master

搜索帮助