-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
95 lines (81 loc) · 2.89 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# -*- coding: utf-8 -*-
"""
# 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).
"""
from setuptools import setup
setup(
name="climage",
version="0.2.0",
description="Convert images to beautiful ANSI escape codes",
long_description=__doc__,
long_description_content_type="text/markdown",
url="http://github.com/pnappa/CLImage",
author="Patrick Nappa",
author_email="patricknappa@gmail.com",
license="MIT",
packages=["climage"],
entry_points={
"console_scripts": [
"climage = climage:main",
]
},
python_requires=">=3.2",
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Artistic Software",
"Topic :: Multimedia :: Graphics",
"Topic :: System :: System Shells",
"Topic :: Utilities",
],
install_requires=["Pillow", "kdtree"],
zip_safe=False,
)