Python libray for displaying images on terminal
Project description
teimpy
Python library for displaying image on terminal.
Installation
$ pip
Example
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
teimpy-0.1.1.tar.gz
(15.8 kB
view details)
File details
Details for the file teimpy-0.1.1.tar.gz
.
File metadata
- Download URL: teimpy-0.1.1.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.3 CPython/3.6.9 Linux/4.15.0-74-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 023a58caf95069c3d388db4217cff97172b639e67ec97d815b82288a0fb4a309 |
|
MD5 | 0e1ed06371f87ddabe08d6d315fa3d71 |
|
BLAKE2b-256 | 3a34ab1533d6af29920ee90eac1c8da293e3767481ee27c377f6670c512e6407 |