https://github.com/ar90n/teimpy
Python library for displaying image on terminal.
https://github.com/ar90n/teimpy
console console-tool image my-projects terminal-graphics
Last synced: 4 months ago
JSON representation
Python library for displaying image on terminal.
- Host: GitHub
- URL: https://github.com/ar90n/teimpy
- Owner: ar90n
- License: mit
- Created: 2018-11-04T17:21:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-08T03:36:17.000Z (over 3 years ago)
- Last Synced: 2025-11-17T05:21:27.103Z (8 months ago)
- Topics: console, console-tool, image, my-projects, terminal-graphics
- Language: Python
- Homepage:
- Size: 1.83 MB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# teimpy
Python library for displaying image on terminal.
[](https://github.com/ar90n/teimpy/actions/workflows/workflow.yml)
[](https://badge.fury.io/py/teimpy)
[](https://raw.githubusercontent.com/amplify-education/serverless-domain-manager/master/LICENSE)
## Installation
```bash
$ pip
```
## Example
```python
import numpy as np
from teimpy import get_drawer, Mode
R = np.array([1.0, 0, 0])
G = np.array([0, 1.0, 0])
B = np.array([0, 0, 1.0])
def _get_color(x, y):
tmp = (y * (1.0 - x) * R + (1.0 -y ) * x * G + (1.0 - y) * (1.0 - x) * B)
return (255 * tmp).astype(np.uint8)
tics = np.linspace(0, 1, 128)
xs, ys = np.meshgrid(tics, tics)
buffer = np.vectorize(_get_color, signature='(),()->(3)')(xs, ys)
print(get_drawer(Mode.ITERM2_INLINE_IMAGE).draw(buffer))
```

## Feature
* Resize images to fit terminal size.
* Drawing with iterm2 inline image.

* Drawing with Braille fonts.

* Drawing with half block fonts.

## License
This software is released under the MIT License, see [LICENSE](LICENSE).