A simple terminal-based image viewer.
Project description
textual-imageview
textual-imageview
is a both a CLI tool and Textual widget and for viewing images in the
terminal.
Usage
Use the vimg
CLI command to quickly view an image in the terminal.
vimg <path_to_image>
Click and drag (or press W/S/A/D) to move around the image, and scroll (or press -/+) to zoom in/out of the image.
vimg
is built on ImageView
, a Rich renderable that renders images with padding/zoom, and ImageViewer
, a Textual widget that adds mouse interactivity to ImageView
. Add textual-imageview
as a dependency to use them in your Textual app!
At the highest zoom level, each character corresponds to two image pixels. I've found that vimg
works best with a GPU-accelerated terminal like Alacritty.
Installation
pip install textual-imageview
FAQ
vimg
works great locally, but colors aren't displaying correctly when using vimg
over SSH. Why?
Rich determines terminal color support by checking if the COLORTERM
environment variable is set to truecolor
or 24bit
.
echo $COLORTERM
If you know your terminal emulator supports truecolor - i.e., vimg
works great locally - try setting the environment variable manually:
export COLORTERM=truecolor
License
textual-imageview
is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file textual_imageview-0.1.1.tar.gz
.
File metadata
- Download URL: textual_imageview-0.1.1.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4299d8ed677db0adb8fe945687470cf1421dcafd2a5dddab54b6ee8ef2ab3320 |
|
MD5 | a6f981fc448ed9333446e4027d412368 |
|
BLAKE2b-256 | 4b313d8a517bd8694ee0d70fd260fbc20590f00a5fcde6ca1ce2edb174c000ac |
File details
Details for the file textual_imageview-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: textual_imageview-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 335c8043e2f1f735b1b2ec1753a743d6762578175cd2cedae3ce67e2694800a4 |
|
MD5 | f105e826192b667586eb86a72e928afd |
|
BLAKE2b-256 | 4356c0514dcfdb2b67333bf4e653ca9cf0fda51004932d3b246bf835376cbaba |