Python terminal image renderer
Project description
Imgrender: Python Terminal Image Viewer
Terminal image viewer in python, inspired by https://github.com/stefanhaustein/TerminalImageViewer. A piece of software designed to render images on the linux/bash command line. It can either be used as a CLI or as a python library. It should work on most modern terminals, including mobaxterm for windows and jupyter notebooks.
Usage
Command Line
usage: imgrender [-h] [--width WIDTH] [--height HEIGHT] path
Render images on the command line
positional arguments:
path the image path
optional arguments:
-h, --help show this help message and exit
--width WIDTH width of the rendered image (default 60 pixels)
--height HEIGHT height of the rendered image (default 60 pixels)
Python Library
Simply import the render function from the imgrender library. The function has two arguments, the image path (positional), and the scale parameteter (keyword), which takes a tuple with two integer (height, width)
for instance:
In [1]: from imgrender import render
In [2]: render('frog.jpg', scale=(40, 60))
(this will render the image stored in 'frog.jpg' with 40x60 pixels)
The render function can be called without passing in a scale argument, this will use the default scale parameters of (60, 60)
Results
below is an image of the city of Portsmouth generated as a 60x60 visualization.
And here is the original image
Finally, here is the same imaged visualised as 250x250 pixels
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 imgrender-djentleman-0.0.2.tar.gz
.
File metadata
- Download URL: imgrender-djentleman-0.0.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 984d2f8eccc7dbe682ad67eb3f02f154da836fab131718fa7efedde5a98b9cd3 |
|
MD5 | 090c4b0b6f19116cf9771e9751fdf37e |
|
BLAKE2b-256 | a526d39c00fd449c8759a0f6f54177ad9b05fd90cbfa2d21d2ba461d844f0fe8 |
File details
Details for the file imgrender_djentleman-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: imgrender_djentleman-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26b7768e13fc5ecb40ec322fe7f58ae51c670b2844fce8e7dd8a320679ef14cd |
|
MD5 | 6efc56d6372e4e7c50763c23467c8c73 |
|
BLAKE2b-256 | 9f8ffa922d510fa795ed85133cbae51a23e03608b107f72f4e9a357f5b51ca4a |