Skip to main content

Show images directly on terminal using Xterm colors.

Project description

Img2sh

Img2sh is a tool to show images directly on terminal. For color images 256 xterm color support is required. This script basically resize the image with antialliasing and quantized its colors to xterm color pallette.

Demo

Testing the package is super easy. Install and run.

pip install img2sh --user
img2sh demo.jpeg

Result:

Demo with interactive mode

img2sh demo.jpeg -w 80 -i

q: quit z: zoom+ x: zoom- c: reset 
arrow keys for navigation 
cmd: q

For detailed usage arguments:

$ python img2sh/cli.py --help

usage: cli.py [-h] [-w WIDTH] [-i] Image

Show images directly on terminal.

positional arguments:
  Image                 the directory of the image which will be opened

optional arguments:
  -h, --help            show this help message and exit
  -w WIDTH, --width WIDTH
                        image width on the terminal
  -i, --interactive     open image in interactive mode

Installing

It can be easily install using pip.

pip install img2sh --user

Installing from source:

git clone https://github.com/mozanunal/img2sh
cd img2sh
pip install -r requirements.txt
python setup.py install

Development

Setup development environment

Conda is using for environment management.

conda create -n img2sh python=3.8

Following command should be executed to create interactive shell in this conda environment.

conda activate img2sh

Development

In this repo issue based development is active. For any problems or new enhancements please open a issue.

Autopep8 is used for formatting.

autopep8 -r -i img2sh test

Pylint is used for linting.

pylint img2sh

Deployment

The following 2 commands are required to deploy over pypi.

python setup.py sdist bdist_wheel
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

Licence

MIT

Acknowledges

This package is developed using:

Contributors

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

img2sh-0.2.2.tar.gz (293.6 kB view details)

Uploaded Source

Built Distribution

img2sh-0.2.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file img2sh-0.2.2.tar.gz.

File metadata

  • Download URL: img2sh-0.2.2.tar.gz
  • Upload date:
  • Size: 293.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for img2sh-0.2.2.tar.gz
Algorithm Hash digest
SHA256 86526c29e1e6fb1c5d82b1236f50d8225dcc5116e58cc61cde498747a4440c04
MD5 97206e771718389a2339aafa9fa24f67
BLAKE2b-256 1fa41664e324a4b77341f66a6b41c63afdcb6150db4290de1b6c03e4a4d2b5c0

See more details on using hashes here.

Provenance

File details

Details for the file img2sh-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: img2sh-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for img2sh-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cab052848f87cead15eb3c21e5b42088e1ba13d0e59ab2eb286d70d4738ffd3c
MD5 5c62fc630ee977309932c000c89a98ea
BLAKE2b-256 f40ce5a7b12bcd9150396ed3b0b8a199ce3d7426ca0e3dd925c2cbfd20513122

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page