python 生成表情包
2018-02-27 22:31
120 查看
#-*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding("gbk")
import os
import pygame
from pygame.locals import *
pygame.init()
from PIL import Image, ImageDraw, ImageFont
img = Image.open("head.jpg")#250*250
jgz = Image.open("face.jpg")#101*113
img.paste(jgz,(73,47))#左右,上下
#img.show()
draw = ImageDraw.Draw(img)
ttfront = ImageFont.truetype('simhei.ttf', 24)
draw.text((32, 190),"我的内心毫无波动\n 甚至还想笑".decode('gbk'),fill=(0,0,0), font=ttfront)
#img.show()
img.save("Python生成的表情包.jpg")
相关文章推荐
- python 随机数生成的代码的详细分析
- python 项目自动生成requirements.txt文件
- python_笔记8_生成列表,列表表达式
- Python3 生成一个随机验证码
- python 生成器生成杨辉三角的方法(必看)
- Python 生成随机验证码
- Python抓取浏览器渲染后的网页,生成网页缩略图,pythonwebkit
- [python]使用django快速生成自己的博客小站,含详细部署方法
- 使用Python将TXT文本内容读取后生成指定XML格式的文件
- 教你用Python快速生成各尺寸应用图标和截屏
- python生成二维数组
- Python 生成MySQL 管理员随机复杂秘钥
- python 生成一定范围内的随机数
- 生成dll文件以及python对DLL中函数的调用(参数类型以及返回值)
- Python 随机数生成总结
- python脚本批量生成50000条插入数据的sql语句
- python二维键值数组生成转json
- Python二维码生成库qrcode安装和使用示例
- Selenium(Python)生成Html测试报告
- cxfreeze打包python程序的方法说明(生成安装包,实现桌面快捷方式、删除快捷方式)