Skip to content

Instantly share code, notes, and snippets.

@mattj1
Created December 11, 2022 18:31
Show Gist options
  • Save mattj1/e54097e7b382c9113cd792416c344c6d to your computer and use it in GitHub Desktop.
Save mattj1/e54097e7b382c9113cd792416c344c6d to your computer and use it in GitHub Desktop.
from PIL import Image, ImageFont, ImageDraw
image = Image.new('RGB', (32 * 8, 16 * 16))
draw = ImageDraw.Draw(image)
font = ImageFont.truetype("Px437_IBM_VGA9.ttf", 16)
for i in range(1, 256):
col = i % 32
row = int(i / 32)
draw.text((8 * col, 16 * row), bytes([i]).decode('cp437'), font=font)
image.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment