参考Pillow文档:https://pillow.readthedocs.io/en/3.0.x/reference/Image.html
需求
我有一个矩阵,里面是各种字符,要在中心放一张图片。效果大概如下图:(模拟数据,模拟图片)
代码
def test_draw(matrix, ch_width, logo_width, logo_file_name, out_file_name, ttf_file_name='stencil.ttf'):
side_len = len(matrix)
image_widt