""" artify.py
画像をAA(アスキーアート)にするスクリプト
"""
from PIL import Image
from numpy import asarray
# デフォルト(16色)のパレット
pixs = [" ", ".'", "::", "||",
"TT", "11", "[]", "ff",
"55", "WW", "99", "dd",
"RR", "GG", "%%", "@@"]
pixs.reverse()
# 多色(195色)のパレット
pixs_ = [
' ', '` ', '. ', '- ', '" ',
'''', '``', '^ ', '.`', ', ',
'-`', '< ', '_ ', '"`', ''^',
'/ ', '"-', ',`', '.:', ''>',
'<`', '_`', ''~', '._', '-<',
'-_', '/`', 'c ', 'Y ', '"_',
'-/', '<^', 'r'', 'y ', ''|',
'r.', '<>', 'C ', 'c'', '!!',
'Y`', 'v"', '")', '~~', '"+',
'U ', 'v:', '):', ''}', 'K'',
'a ', '(>', ',=', 'o'', 'w`',
'!|', 'S'', 'U'', 'n"', 'l"',
'7_', 'i,', 'a'', 'n:', 'k"',
'f"', 'A-', '$ ', '2:', 'k:',
'o,', 'E-', 'h^', 'j>', 'M"',
'u/', '2~', 'e^', 'f~', 'M:',
'$`', 'cY', 'A!'
Python