Reputation: 1581
You can print to the terminal using print("Hello World") but can you print an image? If you can, how?
Upvotes: 2
Views: 10289
Reputation: 66478
It's possible with ANSI art (that use ANSI escape codes), Check this JavaScript library https://github.com/patmooney/node-terminal-art
or web browser that render web pages in terminal https://www.brow.sh/ (including images).
As you can see this is possible, terminal give you this, so you can implement such a library in any language or search if there is already one in Python.
EDIT some terminals also support Sixel format that allow o render bigger resolution images.
Upvotes: 2
Reputation: 69021
If by print an image
you mean displaying the pretty graphic, no. If you mean printing something that kinda/sorta if you stand back a bit and squint looks like the image (otherwise knows as ascii art), then yes -- if you have a library that supports converting from binary.
Upvotes: 4