Registry / http-networking / climage

climage

JSON →
library0.2.2pypypi✓ verified 85d ago

CLImage is a Python library for converting images into ANSI escape code strings, enabling terminal image display using TrueColor, 256-color, or monochrome palettes. Current version 0.2.2, updated to support Python >=3.2. Releases are infrequent.

pip install climage
INSTALL
IMPORT
SIG · CLIMAGE
C
climage
http-networkingpythonv0.2.2
Install
2.3s avg
Import
78ms
Disk
36MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.082s · 37.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.3s · import 0.074s · 38MB
36MB installed
● package 36MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

convert
from climage import convert
import climage; climage.convert()
The convert function is not a module-level attribute; it must be imported explicitly.

Converts a PIL Image to ANSI escape codes and prints to terminal.

from climage import convert from PIL import Image img = Image.open('example.png') output = convert(img, is_unicode=True, is_truecolor=True, is_256color=False) print(output)
climage --version
Debug
Known issues
gotchaThe `convert` function expects a PIL Image object, not a file path. Passing a string will cause AttributeError.
fix
Always open the image with Image.open() before passing to convert.
affects: all
gotchaTrueColor output may not render correctly on terminals that do not support 24-bit color. Use is_truecolor=False or is_256color=True for compatibility.
fix
Set is_truecolor=False and is_256color=True for broader terminal support.
affects: all
gotchaThe library currently only supports PNG, JPEG, and BMP formats via Pillow. Other formats may raise UnidentifiedImageError.
fix
Convert image to a supported format before using climage.
affects: all
Errors
Common errors & fixes
AttributeError: module 'climage' has no attribute 'convert'
Using `import climage` and then calling `climage.convert()` - the function must be imported explicitly.
fix
Use `from climage import convert` or access `climage.climage.convert` after import.
AttributeError: 'str' object has no attribute 'size'
Passing a file path string directly to `convert` instead of a PIL Image object.
fix
Open the image first: `from PIL import Image; img = Image.open('path.png')` then pass `img`.
ValueError: unknown image format
Attempting to convert an unsupported image format (e.g., WebP, SVG).
fix
Convert the image to PNG or JPEG before processing, e.g., using Pillow's convert.
Upgrade
Version history
0.2.2latest on PyPI · released Sep 29, 2024
Audit
Dependencies
pillowrequiredRequired for image loading and conversion
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
climage — pip install climage · libregistry