Skip to main content

img2hbterm

Image to Half-block ANSI art with 256-color XTerm codes.

Installation

As a CLI app

pipx install img2hbterm

As a module

pip install img2hbterm

CLI Usage

Simply convert using

img2hbterm image.png

Flags:

  • --nearest -n uses nearest neighbor to resize the image. (useful if antialiasing makes the output look too blurry)
  • --true-color -t uses True Color instead of XTerm 256-color. (less term support)
  • --width <int> -s <int> set the width of the image. (default: 128)

Module usage

from img2hbterm import convert
from io import BytesIO

print( convert("path") )

# The path can be anything Pillow supports, so BytesIO works as well
print( convert(BytesIO(b"....")) )

# With all the default values included
print(
    convert(
        "path",
        nearest=False,
        true=False, # Not to be confused with the boolean True
        size=128
    )
)

# Works the same way the CLI does, I don't need to document the parameters again.

Metadata

Release files for img2hbterm 1.0.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 img2hbterm 1.0.1
File Size Uploaded
img2hbterm-1.0.1.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for img2hbterm 1.0.1
File Interpreter ABI Platform
img2hbterm-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / img2hbterm-1.0.1.tar.gz

Download URL img2hbterm-1.0.1.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
75ef9eb5a866c4235244078c6bfe1ea9345470d2d907f1205bf4d779bfd5c256
BLAKE2b-256 checksum
How to use checksums
2dc341f1cc43c83365a5c9bd6a365ade302e25c3cf54ddb193cced2136b37185
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.24

Release files / img2hbterm-1.0.1-py3-none-any.whl

Download URL img2hbterm-1.0.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
940de597bea367f69ab75babfefe709010eb087ba5bb736eba50823f111db6ef
BLAKE2b-256 checksum
How to use checksums
6e8430eeae33921abf8d830696da803c89952be947a0bbef658410b6f624d945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.24

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

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