使用xterm颜色直接在终端上显示图像。
img2sh的Python项目详细描述
img2sh
img2sh是一种直接在终端上显示图像的工具。 对于彩色图像,需要256 xterm颜色支持。这个脚本基本上通过反对齐调整图像的大小,并将其颜色量化为xterm颜色托盘
演示
测试这个包是非常容易的。安装并运行
pip install img2sh --user
img2sh demo.jpeg
结果:
带交互模式的演示
img2sh demo.jpeg -w 80 -i
q: quit z: zoom+ x: zoom- c: reset
arrow keys for navigation
cmd: q
有关详细的用法参数:
$ 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
安装
它可以很容易地安装使用pip。
pip install img2sh --user
从源安装:
git clone https://github.com/mozanunal/img2sh
cd img2sh
pip install -r requirements.txt
python setup.py install
发展
设置开发环境
Pipenv用于环境管理
pipenv install --dev
应执行以下命令在此pipenv中创建交互式shell。
pipenv shell
开发
在此回购中,基于发行的开发是活跃的如果有任何问题或新的增强功能,请打开一个问题。
autopep8用于格式化。 皮林是用来起毛的。
部署
在pypi上部署需要以下两个命令
python setup.py sdist bdist_wheel
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
许可证
麻省理工学院
承认
此软件包的开发使用: