Skip to main content

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

Metadata

Release files for img2sh 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for img2sh 0.2.2
File Size Uploaded
img2sh-0.2.2.tar.gz 293.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for img2sh 0.2.2
File Interpreter ABI Platform
img2sh-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 301.1 kB

Release files / img2sh-0.2.2.tar.gz

Download URL img2sh-0.2.2.tar.gz
Size 293.6 kB
Tags Source
SHA-256 checksum
How to use checksums
86526c29e1e6fb1c5d82b1236f50d8225dcc5116e58cc61cde498747a4440c04
BLAKE2b-256 checksum
How to use checksums
1fa41664e324a4b77341f66a6b41c63afdcb6150db4290de1b6c03e4a4d2b5c0
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / img2sh-0.2.2-py3-none-any.whl

Download URL img2sh-0.2.2-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cab052848f87cead15eb3c21e5b42088e1ba13d0e59ab2eb286d70d4738ffd3c
BLAKE2b-256 checksum
How to use checksums
f40ce5a7b12bcd9150396ed3b0b8a199ce3d7426ca0e3dd925c2cbfd20513122
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.1.8

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page