[Python] PIL(Python Image Library) 이미지에 텍스트 넣기.
1. pillow 설치 python -m pip install pillow 2. 소스단 from PIL import Image, ImageDraw, ImageFont def createImg(textData, width, height): fontSize = 13 img = Image.new("RGB", (width, height), color = (0, 0, 0)) fnt = ImageFont.truetype("폰트 경로", fontSize, encoding="UTF-8") # 텍스트가 시작될 X, Y 좌표 textPosition01 = 10 textPosition02 = 10 d = ImageDraw.Draw(img) d.text((textPosition01,textPosition02), textDat..
공장 (factory)/- Programming..
2020. 4. 9. 17:02