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

Pipenv is using for environment management.

pipenv install --dev

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

pipenv shell

Development

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

Autopep8 is used for formatting. Pylint is used for linting.

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.1.8.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

img2sh-0.1.8-py2-none-any.whl (7.1 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: img2sh-0.1.8.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for img2sh-0.1.8.tar.gz
Algorithm Hash digest
SHA256 5e57e91effc5397cba81656eec56b050e4c1201ec70b3b0f664c73a23e643cc7
MD5 10d01ac5dd9e9af2a69ce0b8f12af4ce
BLAKE2b-256 b7f347007878dacc8128eee010877983cb502d7df218e8c6941abce1d9b74235

See more details on using hashes here.

File details

Details for the file img2sh-0.1.8-py2-none-any.whl.

File metadata

  • Download URL: img2sh-0.1.8-py2-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for img2sh-0.1.8-py2-none-any.whl
Algorithm Hash digest
SHA256 8acfe15346c61e36e245a4c222ead174f4567cc4490b3381ab60ac0e2c51ee76
MD5 b5af36391082e03587a82266c0cd1f62
BLAKE2b-256 4f3b7310c896a8be9938c48f186c2ddbff7b6eddeae4ea8c0f70f7c3c3585296

See more details on using hashes here.

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