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 -nuses nearest neighbor to resize the image. (useful if antialiasing makes the output look too blurry)--true-color -tuses 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)
| File | Size | Uploaded | |
|---|---|---|---|
| img2hbterm-1.0.1.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|