Skip to main content

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.

Installation

to Install imgrender, run pip install imgrender

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.

Rendered

And here is the original image

Original

Finally, here is the same imaged visualised as 250x250 pixels

Rendered

Metadata

Release files for imgrender 0.0.4

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

Source distribution (sdist)

Source distribution for imgrender 0.0.4
File Size Uploaded
imgrender-0.0.4.tar.gz 2.9 kB Details

Release files / imgrender-0.0.4.tar.gz

Download URL imgrender-0.0.4.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3141fd8e3c5cc0ae5d956cf0df375e14bd7a93798c265a2c3bc66a0b19e08e7c
BLAKE2b-256 checksum
How to use checksums
4b0152f825c2a4656517ceba8f8b3a79cca6bb9c7ed85486e045db2a6520e844
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.3

2 release files

0.0.2

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