Skip to main content

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

Project description

pypackage

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.

From 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 script:

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

# Do not display
# img_str = display_image("myImage.jpg", display=False)

Help menu

imageinterminal -h
Usage:
  iit image_uris [options]

                                                                                   Image In Terminal
                                                                                         v1.3
                                                                                       by Odell
                                                                                       2023-2025
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 N         Destination width of the image(s).
  -wt, --whiteness-threshold N.
                        (float [0 - 1]). Pixels with a whiteness higher than this value will be inverted.
  -dt, --darkness-threshold N.
                        (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.
  -ll, --log-level N    Log level. Default: 20. CRITICAL = 50, FATAL = CRITICAL, ERROR = 40, WARNING = 30, INFO = 20, DEBUG = 10, NOTSET = 0

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).

Donate

If you find my work useful and want to encourage further development, you can do so by donating

TON

UQCyCnWVYOmv97idVFZ4tIewToZacRhYVwfGNU658fN5w3Kl

Bitcoin

bc1qvnu237er6rxt8cazze6lx3dme66n60gjwgh2mx

Speed Lightning Address username

bytechanger@speed.app

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.3.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

image_in_terminal-1.3-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file image_in_terminal-1.3.tar.gz.

File metadata

  • Download URL: image_in_terminal-1.3.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for image_in_terminal-1.3.tar.gz
Algorithm Hash digest
SHA256 5f9154cbc6d01975e2ecd4c8e50d61d0d02e2529e018c41512583050c545ca04
MD5 35631471a03a5fe4fb37c25c024aa7db
BLAKE2b-256 eec27228d5e01d21270a0c95850b9a2f26e50762bca3ff087dae568934b3cc8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for image_in_terminal-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c410cdb7c6855e2be06d935b1afb3e555bb7e4bd84c53b94ea6b153a78fe063b
MD5 3261c7c09b4d9576124e4bd613935887
BLAKE2b-256 4ceff56ba65b29b2c5e35305d5ad875b40a39801d012ec9ade0f0347eed0cde7

See more details on using hashes here.

Supported by

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