Friday, May 4, 2018

python lib showcase: pyg-to-term

pygtotermlib.py is a python library of mine that converts pygame surfaces to block-graphics (think ansi-art), ready to be printed to a *nix-style terminal.

So what can you do with it?

The chart on the right shows the 5 main conversion modes. (interpolation options for the first and third modes not shown)

The second and fourth options use 256-color escape sequences, while the last one uses 24bit-color escape sequences.

While these modes allow nicer output, there is a catch: not all terminals will actually show these modes properly.

pyg-to-term on Github

No comments:

Post a Comment