Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erickrus/termpix
Display images in an ANSI terminal (rewritten in python3)
https://github.com/erickrus/termpix
python3 terminal terminal-graphics tui
Last synced: 2 months ago
JSON representation
Display images in an ANSI terminal (rewritten in python3)
- Host: GitHub
- URL: https://github.com/erickrus/termpix
- Owner: Erickrus
- License: other
- Created: 2021-08-16T23:53:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-08T05:18:52.000Z (over 3 years ago)
- Last Synced: 2024-11-12T09:51:11.164Z (2 months ago)
- Topics: python3, terminal, terminal-graphics, tui
- Language: Python
- Homepage:
- Size: 4.72 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# termpix
Draw images in an ANSI terminal! Requires that your terminal can show ANSI colours, and uses a font that can show the 'bottom half block' character (▄).
Usage: `python3.9 termpix.py [--width ] [--height ] [--true-color|--true-colour] [--output output.txt]`
filename or url can be any `image` file readable by the python 'PIL' library or can be any `video` file readable by `imageio`. It also supports HEIC format, if `pyheif` and `libffi libheif` are installed. If you type camera as the filename, you can view your webcam video.
It will fill as much of the terminal as possible, while keeping the aspect ratio of the input image. Use --width or --height to override this.
Try this command:
`python3.9 termpix.py https://img.blogs.es/anexom/wp-content/uploads/2020/10/mario-destacada_E.jpg --true-color` . And you will see:[![asciicast](https://asciinema.org/a/cEW7FK66bmr0wsmRNcMpocx1D.svg)](https://asciinema.org/a/cEW7FK66bmr0wsmRNcMpocx1D)
This library is also extended to play video in terminal (with audio), you can try the `python3.9 termpix.py `
[![asciicast](https://asciinema.org/a/yuogBz7sZaSwLmRBN4BGcTv6v.svg)](https://asciinema.org/a/yuogBz7sZaSwLmRBN4BGcTv6v)
This project is much inspired by the following repository:
https://github.com/hopey-dishwasher/termpix# Installing
`# if you want to play video, followings are required``# apt install -y portaudio ffmpeg`
`pip3 install -r requirements.txt`
# License
Apache 2.0 license