DOS Punk Text
Inspired by MAX CAPACITY's DOS Punks & the amazing DOS Punk community.
DOS Punk Text is a Python 3 script that renders a DOS Punk image as coloured text in the console and exports the text & colour map to a JSON file.
The characters in the DOS Punk image are matched against a unicode version of the original DOS Code Page 437 character set using the Hamming distance between average image hashes.
#DOSLIFE
Requirements
Requires Python 3 and the Pillow image processing library:
pip install pillow
For best results use BlockZone as your console font. A copy of the BlockZone font is included in this repository.
Usage
python DosPunkText.py "path/to/DosPunkImage.png"
# display the DOS Punk image as text in the console
# and export text & colour map to JSON file
python DOSPunkText.py DOSPunk132.png
# save the DOS Punk & font image blocks used during the matching process
python DOSPunkText.py DOSPunk132.png --debug
Acknowledgments
MAX CAPACITY, greencross and the rest of the DOS Punk community!
BlockZone's pixel-perfect recreation of the original IBM VGA font
PhotoHash for the average hash & Hamming distance algorithms
colortrans for converting RGB to 256bit XTERM pallet