#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'第 0000 题：将你的 QQ 头像（或者微博头像）右上角加上红色的数字，类似于微信未读信息数量那种提示效果。 类似于图中效果'

__author__ = 'Drake-Z'

from PIL import Image, ImageDraw, ImageFont

def add_num(filname, text = '4', fillcolor = (255, 0, 0)):
    img = Image.open(filname)
    width, height = img.size
    myfont = ImageFont.truetype('C:/windows/fonts/Arial.ttf', size=width//8)
    fillcolor = (255, 0, 0)
    draw = ImageDraw.Draw(img)
    draw.text((width-width//8, 0), text, font=myfont, fill=fillcolor)
    img.save('1.jpg','jpeg')
    return 0

if __name__ == '__main__':
    filname = '0.jpg'
    text = '4'
    fillcolor = (255, 0, 0)
    add_num(filname, text, fillcolor)
@@ -101,16 +101,8 @@
 %E7%A4%BA%E6%95%88%E6%9E%9C%E3%80%82
- %E7%B1%BB%E4%BC%BC%E4%BA%8E%E5%9B%BE%E4%B8%AD%E6%95%88%E6%9E%9C
 '%0A%0A_

Fix 0000