#!/usr/bin/python import sys import struct import PIL.Image as Image text = """\ 10 poke53280,0:poke53281,1 20 print"\xd0\xd3"; 30 fory=0to7 40 forx=0to15 50 poke49152+111+x+80*y,x+16*y 60 next 70 next 80 list""" lowercase = False if sys.argv[1] == '-l': lowercase = True del sys.argv[1] def toscreencode(ch): cc = ord(ch) if '`' <= ch <= '~': return cc - 96 return cc charset = open(sys.argv[1], "rb").read() FG = 0xFFDE7886 BG = 0xFFAA3A48 def putcat(img, r, c, code, lowercase): inverse = code & 128 code = code % 128 idx = code*8 for y in range(8): data = charset[idx+y+lowercase*1024] if not inverse: data = ~data for x in range(4): if ~data & (1<<(3-x)): img.putpixel((8+4*c+x,8+8*r+y), FG) BG_buf = struct.pack('