Skip to content

superbright-00/dos-punk-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Alt text

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.

Use the original 1280 x 1280 DOS Punk image where possible. For low res images use the --optimize flag to optimize for character matching over color matching.

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

# optimize character matching over color matching for low res images
python DOSPunkText.py DOSPunk132.png --optimize

# use both space & full-block characters when matching
python DOSPunkText.py DOSPunk132.png --matchfullblocks

# 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

License

MIT

About

Convert a DOS Punk image to text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages