The flexible image display.
Project description
imshow
The Flexible Image Display
Imshow is a Python app to display images.
Imshow gives you:
- Fast and clean display via OpenGL backend;
- Flexibility via command-line and code interfaces;
- Customizability via plugin system.
Installation
python3 -m pip install imshow
Usage
Command-Line
imshow examples/*.jpg
imshow examples --recursive # --recursive (-r)
imshow examples -r --plugin tile --col 3 # --plugin (-p)
Python
import glob
import imgviz
import imshow
images = (imgviz.io.imread(filepath) for filepath in glob.glob("examples/*.jpg"))
imshow.imshow(images)
Builtin plugins
-p base
(default)
imshow examples/*.jpg
imshow examples --recursive # auto-search image files
-p tile
imshow examples/*.jpg -p tile --col 3 --row 3
imshow examples/*.jpg -p tile --col 3
-p mark
imshow examples/*[0-9].jpg -p mark --mark-file examples/mark.txt
Custom plugins
See plugins/base.py
for the most basic example.
For more examples, check all of the plugins
.
imshow examples/*.jpg --plugin custom_plugin.py
# custom_plugin.py
import imshow
from imshow.plugins import base
class Plugin(base.Plugin):
@staticmethod
def add_arguments(parser):
base.Plugin.add_arguments(parser)
# define additional command line options
parser.add_argument("--option1", type=int, ...)
option1: int
def __init__(self, args):
super().__init__(args, args)
self.option1 = args.option1
def get_items(self):
# convert command line options into items to visualize.
# each item represent the chunk that is visualized on a single window.
yield from base.get_items()
def get_image(self, item):
# convert item into numpy array
return base.get_image(item=item)
def get_title(self, item):
# convert item into str
return base.get_title(item=item)
License
MIT
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
imshow-0.1.4.post0.tar.gz
(20.4 MB
view hashes)
Built Distribution
Close
Hashes for imshow-0.1.4.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72ffea8ef02b4670e2a8f5d6678bd30e69d9c421237381aea6b1dbd563cbd675 |
|
MD5 | bfdb9d8ffb93d670e9d04622665780bb |
|
BLAKE2b-256 | 77cf830220988de3f976a1ed9f45f4c6749cd36300de59784f66f2d9e2eef096 |