Metadata-Version: 2.1
Name: climage
Version: 0.2.0
Summary: Convert images to beautiful ANSI escape codes
Home-page: http://github.com/pnappa/CLImage
Author: Patrick Nappa
Author-email: patricknappa@gmail.com
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Artistic Software
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: System :: System Shells
Classifier: Topic :: Utilities
Requires-Python: >=3.2
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Pillow
Requires-Dist: kdtree


# CLImage

Convert images to beautiful ANSI escape codes for display in command line interfaces.

Available as both a CLI application and a Python library.

![demo](https://raw.github.com/pnappa/CLImage/master/extra/demo.png)

## Features
 - 8/16/256/Truecolor supports
 - Custom system color palettes
 - Toggleable Unicode mode, allowing up to 4x more detail
 - Custom output size

## Example usage
### CLI
`$ climage --unicode --truecolor --cols 80 barney.jpg`

![cliusage](https://raw.github.com/pnappa/CLImage/master/extra/clibarney.png)

For more detail and available options, run `$ climage --help`.

### Python
```python3
import climage

output = climage.convert('image.png', is_unicode=True)
print(output)

# Converting downloaded file
from PIL import Image
import requests
response = requests.get('https://www.python.org/static/community_logos/python-logo-master-v3-TM-flattened.png')
# Convert to RGB, as files on the Internet may be greyscale, which are not
# supported.
img = Image.open(BytesIO(response.content)).convert('RGB')
# Convert the image to 80col, in 256 color mode, using unicode for higher def.
converted = climage.convert_pil(img, is_unicode=True)
print(converted)

# Convert the image into 50px * 50px, as the convert_array function does not
# perform resizing.
img = Image.open('image.png').convert('RGB').resize((50, 50))
arr = np.array(img)
output = climage.convert_array(arr, is_unicode=True)
print(output)
```

View additional examples on the [project homepage](https://github.com/pnappa/CLImage).

