def drawText_Color(cimg, txt, posxy, fz, color):
ttFont0 = ImageFont.truetype(fontfile, fz)
im = Image.fromarray(cimg, 'RGB')
drawable = ImageDraw.Draw(im)
drawable.text((posxy[0], posxy[1]), txt, fill=color, font=ttFont0)
npimg = np.asarray(im)
return npimg
评论列表
文章目录