![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图片验证码拼接
奋斗的小渣渣
这个作者很懒,什么都没留下…
展开
-
Python 实现文字转为图片
话不多说直接上代码#先导入所需的包import pygameimport ospygame.init() # 初始化B = '请依次点击 "你" "好" "啊"' # 变量B需要转图片的文字text = u"{0}".format(B) # 引号内引用变量使用字符串格式化#设置字体大小及路径font = pygame.font.F...原创 2018-12-07 20:37:30 · 6702 阅读 · 3 评论 -
Python实现多张图片纵向拼接并剪裁多余部分
话不多说直接上代码使用Python的PIL#先导入所需的包from PIL import Imagefrom os import listdirims = [Image.open(fn)for fn in listdir() if fn.endswith(".png")] # 打开路径下的所有图片width,height = ims[0].sizeresul...原创 2018-12-07 22:03:43 · 2114 阅读 · 0 评论 -
python实现图片上打印文字
话不多说直接上代码#先导入所需的包from PIL import ImageFont, Image, ImageDraw#导入本地字体路径及设置字体大小font = ImageFont.truetype("/Users/akun/Library/Fonts/msyh.ttf",13)#打开本地所需图片imageFile = "captch.png"im1=Image.open(im...原创 2018-12-07 22:13:45 · 2934 阅读 · 0 评论 -
python实现删除当前/指定路径下的文件/图片
话不多说直接上代码#先导入所需的包import os#指定路径path = '/Users/akun/Desktop/项目/PaChongcode/Image/'for root, dirs, files in os.walk(path): for name in files: if name.endswith(".png"): # ...原创 2018-12-07 22:19:45 · 15719 阅读 · 0 评论