看到很多美术家用自己心爱的女生的几万个签名拼成了一幅画,程序员想着我也可以写程序来做这件事丫~
下面是效果图,520/521 大家可以用它来表白hhhhh:)
本人的github地址:https://github.com/dupeipei/syntheticed-name
希望看到的人能够点个⭐️,给大家比个❤️
import random
from PIL import Image, ImageDraw, ImageFont
# 显示的名字
text = "范卓轩"
# 名字的大小
font_size = 660
# 显示的长度
display_width = 2000
# 显示的宽度
display_height = 1080
# 系统文字的路径
font_path = "/System/Library/Fonts/STHeiti Medium.ttc"
# 显示的名字数量
name_count = 52014
def generate_mirror_text(text, rotate_angle, size):
"""
Get the rotated image.
:param text: Displayed text which is small.
:param rotate_angle: Angle of rotation.
:param size: The font size of small text.
:return: The ratated image.
"""
font