Pygame模块一览表:
 
  
  
  
  引入pygame模块 ,若本机没有请自行pip install pygame
 
  
 
import pygame
pygame.init()
text = 
u"文字转图片"
font = pygame.font.SysFont(
'Microsoft YaHei', 
64)
ftext = font.render(text, 
True, (
65, 
83, 
130),(
255, 
255, 
255))
pygame.image.save(ftext, 
"image.jpg") 
  
  
运行结果
 
  
  
 
转载于:https://www.cnblogs.com/bilaisheng/p/10211012.html
                
        
 
相关资源:python实现图片转文字图案