github/Show me the code (0)
https://github.com/Show-Me-the-Code/show-me-the-code
第 0000 題:將你的 QQ 頭像(或者微博頭像)右上角加上紅色的數字,類似於微信未讀資訊數量那種提示效果。類似於圖中效果
from PIL import Image, ImageDraw, ImageFont
def add_num(pic_path, num):
img = Image.open(pic_path)
x, y = img.size
font = ImageFont.truetype("/usr/share/fonts/truetype/./ubuntu-font-family/Ubuntu-R.ttf", x/4)
ImageDraw.Draw(img).text((3*x/4, 0), str(num), font=font, fill='red')
img.save('icon_with_num.jpg')
if name == "main":
add_num("icon.jpg", 5)
相關文章
- Talk is cheap, show me the code - 用 github 資料輔助你完善簡歷Github
- Show me the code,babel 7 最佳實踐!Babel
- Show Me the Code!然後把Pepper機器人抱回家機器人
- 【show me the code】Python練習題&語法筆記 2Python筆記
- Github教程(0)Github
- 演算法工程師-廈門軟二-純粹的研發團隊氛圍~talk is cheap,show me the code!!演算法工程師
- help ! please send me lomboz3.0.1 source code!
- What is Pay Me to Learn——Google Summer of Code 2013Go
- Github codespaces 初體驗Github
- about me
- Github Colilot VS Code設定Github
- JavaScript show()JavaScript
- jQuery show()jQuery
- show sga和show parameter sga的區別
- READ ME
- Media Encoder 2022 for Mac(ME2022)Mac
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 0: invalid continuation byteUnicodeError
- show master logs 和 show master status 區別AST
- MySQL 5.5 SHOW PROFILE、SHOW PROFILES語句介紹MySql
- JavaScript show() 方法JavaScript
- git show 命令Git
- mysql show命令MySql
- Visual Studio Code 和 GitHub CopilotGithub
- costume GIT usage for meGit
- A Person Who Is Important to MeImport
- github1s: 1秒極速用 VS Code 閱讀 GitHub 原始碼Github原始碼
- 【MySQL】SHOW WARNINGS和SHOW ERRORS的作用是什麼?MySqlError
- git show命令用法Git
- mysql的show processlistMySql
- mysql show processlist stateMySql
- Show_HWM.sqlSQL
- show_space.sqlSQL
- show profiles 詳解
- WPF ProgressBar show value
- Python3解決UnicodeEncodeError: 'ascii' codec can't encode characters in position 0PythonUnicodeErrorASCII
- 在 Github Action 管道內整合 Code Coverage ReportGithub
- Find me - 用 ARKit 找人
- Hey async, await meAI