Skip to main content

Simple Python package to display a single or multiple images in the terminal by converting it into text

Project description

Image In Terminal

Simple Python package to display an image in the terminal by converting it into text. For the desired behavior to be achieved, the terminal must support colors, unicode characters and there should be no spacing between lines (0 line-spacing).

Installation

pip install image-in-terminal

How to use

You can use the package either from the terminal or from a script.

imageinterminal -h

Usage:
  imageinterminal image_uris [options]

                                                  Image In Terminal
                                                        v1.2.5
                                                       by Odell
                                                      2023-2024
Positional Arguments:
  image_uris            File path(s) or HTTP/HTTPS link(s) of the image(s) to be displayed. A directory can also be
                        passed in which case all supported images in the directory will be displayed.

Options:
  -w, --width WIDTH     Destination width of the image(s).
  -wt, --whiteness-threshold WHITENESS_THRESHOLD
                        (float [0 - 1]). Pixels with a whiteness higher than this value will be inverted.
  -dt, --darkness-threshold DARKNESS_THRESHOLD
                        (float [0 - 1]). Pixels with a whiteness lower than this value will be inverted.
  -r, --recursive       If a directory is passed as image_uri the image search will be recursively performed within
                        the directory passed and all its subdirectories.
  -pp, --procedural-printing
                        The image(s) pixels will be printed one by one procedurally instead of printing/displaying the
                        entire image at once. Useful when printing/displaying high resolution images.
  -nc, --no-center      Do not center image(s).
  -nf, --no-fit         Do not automatically fit image(s) width to terminal width when -w/--width is not specified.

Miscellaneous:
  -h, --help            Show this help message and exit.
  -v, --version         Show version number and exit.

Simple Python package to display a single or multiple images in the terminal by converting it into text. For the
desired behavior to be achieved, the terminal must support colors, unicode characters and there should be no spacing
between lines (0 line-spacing).

From the terminal:

imageinterminal "myImage.jpg"
iit "https://images/exampleImage.jpg" "myOtherImage.png" -w 128
iit "myImagesOnWhiteBackgrounds" --width 256 -wt 0.97 
iit myImage2.png --no-fit --no-center

From a python script:

from imageinterminal import display_image
display_image("myImage.jpg")

Screenshots

JPG 1440x1800




JPG 256x256




PNG 256x256




Procedural Printing




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

image-in-terminal-1.2.6.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

image_in_terminal-1.2.6-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file image-in-terminal-1.2.6.tar.gz.

File metadata

  • Download URL: image-in-terminal-1.2.6.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for image-in-terminal-1.2.6.tar.gz
Algorithm Hash digest
SHA256 b115035ff9983fa063725a36603c4e42a33679bfe10b1baf09497cf573d02356
MD5 cefd8f3df4b871fecf4f5ea4f7e8f981
BLAKE2b-256 2e3e481461fbe1a8da0b08fdec0ebb5408f47cc3fa3a71ea1343c95f9a4236ad

See more details on using hashes here.

File details

Details for the file image_in_terminal-1.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for image_in_terminal-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 67dc7cb18e5a2c4abdf726b7c2df8ead6ddd11d07cb9c36bb0d28255cd0e5023
MD5 fa0b5af0124fbb4055678fd59b72e6b9
BLAKE2b-256 9590acfde7d2eb970375007011a1c3daa01c53f0eb170aa602f3fbbc6eeb0ccc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page