Created
December 11, 2022 18:31
-
-
Save mattj1/e54097e7b382c9113cd792416c344c6d to your computer and use it in GitHub Desktop.
This file contains 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
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