Skip to main content

This project is a branch of term-image on QPython.

Quick Start

Creating an instance

  1. Initialize with a file path:

    from term_image.image import from_file
    
    image = from_file("path/to/image.png")
    
  2. Initialize with a URL:

    from term_image.image import from_url
    
    image = from_url("https://www.example.com/image.png")
    
  3. Initialize with a PIL (Pillow) image instance:

    from PIL import Image
    from term_image.image import AutoImage
    
    img = Image.open("path/to/image.png")
    image = AutoImage(img)
    

Drawing/Displaying an Image

There are two basic ways to draw an image to the terminal screen:

  1. Using the draw() method:

    image.draw()
    

    NOTE: draw() has various parameters for render formatting.

  2. Using print() with an image render output:

    print(image)  # without formatting
    # OR
    print(f"{image:>200.^100#ffffff}")  # with formatting
    

For animated images, only the former animates the output, the latter only draws the current frame.

See the tutorial for a more detailed introduction.

Usage

🚧 Under Construction - There will most likely be incompatible changes between minor versions of version zero!

If you want to use this library in a project while it's still on version zero, ensure you pin the dependency to a specific minor version e.g >=0.4,<0.5.

See the docs for the User Guide and API Reference.

Release files for term-image-qpython 0.7.2.1

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

Source distribution (sdist)

Source distribution for term-image-qpython 0.7.2.1
File Size Uploaded
term_image_qpython-0.7.2.1.tar.gz 55.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for term-image-qpython 0.7.2.1
File Interpreter ABI Platform
term_image_qpython-0.7.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 116.5 kB

Release files / term_image_qpython-0.7.2.1.tar.gz

Download URL term_image_qpython-0.7.2.1.tar.gz
Size 55.1 kB
Tags Source
SHA-256 checksum
How to use checksums
de8524c3b4cc822eb5ee0e84c9c4a58a1e5418f5c237a7067ca4b90291294d45
BLAKE2b-256 checksum
How to use checksums
5c12afe4985fab322b3cb746cb5be6b5f52669a17a6547a30870f41f037eec3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.7

Release files / term_image_qpython-0.7.2.1-py3-none-any.whl

Download URL term_image_qpython-0.7.2.1-py3-none-any.whl
Size 61.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c10059115e2a4a22080ccb5b02868722e404aad205c6833bfa13dfb1005ef7e4
BLAKE2b-256 checksum
How to use checksums
b5f7a067b225fc057ddcd60843f8b5d389907cdf4f5b82d01a10120f826d9f0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.7.2.1 This release

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