Created
June 25, 2014 20:54
-
-
Save rpappalax/3a60c4af171e35a8c7e9 to your computer and use it in GitHub Desktop.
Python Pillow library for generating images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PIL | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
# font = ImageFont.truetype("Arial-Bold.ttf",14) | |
font = ImageFont.truetype("ArialUnicode.ttf",34) | |
img=Image.new("RGBA", (500,250),(255,255,255)) | |
draw = ImageDraw.Draw(img) | |
draw.text((0, 0),"This is a test",(0,0,0) ,font=font) | |
draw = ImageDraw.Draw(img) | |
img.save("a_test.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment