目前有如下需求,想用python生成一些图文并茂的图片,然后再与另外一个图片合并(合并风格:局顶,局底,局左,局右),具体就是合并一个饼型图和其注释内容(每份扇型图的名字,所占百分比等).
原始图如下:
代码部分:
from PIL import Image, ImageDraw, ImageFont, ImageFilter
def perform(wordPosition="bottom"):
Img = Image.new("RGBA", pending_img_size,(255,255,255))
Draw = ImageDraw.ImageDraw(Img, "RGBA")
font_type="/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf"
font_size = 16
line_words_image_space = 10
line_space = 5
font = ImageFont.truetype(font_type, font_size)
Draw.setfont(font)
allPendingElements=[{'word':u"binding (GO:0005488)", 'color':"#666666"},
{'word':u"catalytic activity (GO:0003824)", 'color':"#cc9

最低0.47元/天 解锁文章

1341

被折叠的 条评论
为什么被折叠?



