{"id":23434,"library":"climage","title":"CLImage","description":"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.","status":"maintenance","version":"0.2.2","language":"python","source_language":"en","source_url":"https://github.com/pnappa/CLImage","tags":["ansi","terminal","image-conversion","cli"],"install":[{"cmd":"pip install climage","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for image loading and conversion","package":"pillow","optional":false}],"imports":[{"note":"The convert function is not a module-level attribute; it must be imported explicitly.","wrong":"import climage; climage.convert()","symbol":"convert","correct":"from climage import convert"}],"quickstart":{"code":"from climage import convert\nfrom PIL import Image\n\nimg = Image.open('example.png')\noutput = convert(img, is_unicode=True, is_truecolor=True, is_256color=False)\nprint(output)","lang":"python","description":"Converts a PIL Image to ANSI escape codes and prints to terminal."},"warnings":[{"fix":"Always open the image with Image.open() before passing to convert.","message":"The `convert` function expects a PIL Image object, not a file path. Passing a string will cause AttributeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Set is_truecolor=False and is_256color=True for broader terminal support.","message":"TrueColor output may not render correctly on terminals that do not support 24-bit color. Use is_truecolor=False or is_256color=True for compatibility.","severity":"gotcha","affected_versions":"all"},{"fix":"Convert image to a supported format before using climage.","message":"The library currently only supports PNG, JPEG, and BMP formats via Pillow. Other formats may raise UnidentifiedImageError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from climage import convert` or access `climage.climage.convert` after import.","cause":"Using `import climage` and then calling `climage.convert()` - the function must be imported explicitly.","error":"AttributeError: module 'climage' has no attribute 'convert'"},{"fix":"Open the image first: `from PIL import Image; img = Image.open('path.png')` then pass `img`.","cause":"Passing a file path string directly to `convert` instead of a PIL Image object.","error":"AttributeError: 'str' object has no attribute 'size'"},{"fix":"Convert the image to PNG or JPEG before processing, e.g., using Pillow's convert.","cause":"Attempting to convert an unsupported image format (e.g., WebP, SVG).","error":"ValueError: unknown image format"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}