ascii-art-python 1.2.1__tar.gz → 1.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ascii_art_python-1.2.3/MANIFEST.in +2 -0
- ascii_art_python-1.2.3/PKG-INFO +139 -0
- ascii_art_python-1.2.3/README.md +101 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python/__init__.py +1 -1
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python/cli.py +7 -2
- ascii_art_python-1.2.3/ascii_art_python.egg-info/PKG-INFO +139 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python.egg-info/SOURCES.txt +2 -1
- ascii_art_python-1.2.3/docs/example.gif +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/pyproject.toml +2 -1
- ascii_art_python-1.2.1/MANIFEST.in +0 -1
- ascii_art_python-1.2.1/PKG-INFO +0 -305
- ascii_art_python-1.2.1/README.md +0 -268
- ascii_art_python-1.2.1/ascii_art_python.egg-info/PKG-INFO +0 -305
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/LICENSE +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python/ascii_base.py +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python/assets/fonts/GoogleSansCode-Regular.ttf +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python/assets/fonts/KreativeSquareSM.ttf +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python/full_mode.py +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python/new_skool.py +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python/old_skool.py +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python.egg-info/dependency_links.txt +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python.egg-info/entry_points.txt +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python.egg-info/requires.txt +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/ascii_art_python.egg-info/top_level.txt +0 -0
- {ascii_art_python-1.2.1 → ascii_art_python-1.2.3}/setup.cfg +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ascii_art_python
|
|
3
|
+
Version: 1.2.3
|
|
4
|
+
Summary: A Python library and CLI tool for converting images and videos into ASCII art.
|
|
5
|
+
Author-email: Guillem Prieur <prieurguillem38@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python
|
|
7
|
+
Project-URL: Bug Tracker, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python/-/issues
|
|
8
|
+
Project-URL: Source Code, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python
|
|
9
|
+
Project-URL: Documentation, https://guill_prieur.site-prieur.fr/ascii-art-python
|
|
10
|
+
Keywords: ascii,ascii-art,image-to-ascii,video-to-ascii,cli,terminal,terminal-graphics,generator,converter
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
15
|
+
Classifier: Topic :: Multimedia :: Video
|
|
16
|
+
Classifier: Topic :: Terminals
|
|
17
|
+
Classifier: Environment :: Console
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
26
|
+
Classifier: Operating System :: OS Independent
|
|
27
|
+
Requires-Python: >=3.9
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: pillow>=10.0.0
|
|
31
|
+
Requires-Dist: tqdm>=4.65.0
|
|
32
|
+
Requires-Dist: opencv-python-headless>=4.8.0
|
|
33
|
+
Requires-Dist: moviepy>=2.0.0
|
|
34
|
+
Requires-Dist: numpy>=1.24.0
|
|
35
|
+
Requires-Dist: click
|
|
36
|
+
Requires-Dist: importlib_resources; python_version < "3.10"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# ASCII Art Python - Convert Images & Videos to Terminal Graphics
|
|
40
|
+
|
|
41
|
+
<div align="center">
|
|
42
|
+
|
|
43
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
44
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
45
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
46
|
+
[](https://opensource.org/licenses/MIT)
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
ASCII Art Python is a powerful tool to transform your images and videos into ASCII art. Export your creations as text, images, or videos (with audio) and play them directly in your terminal.
|
|
52
|
+
|
|
53
|
+
## Preview
|
|
54
|
+
|
|
55
|
+
Below is an example of an image featuring the Python logo:
|
|
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
|
+
And below, an example of a video featuring Nyan Cat:
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
## Installation
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install ascii-art-python
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
OpenCV Note: This module uses opencv-python-headless. To avoid conflicts with opencv-python, it is highly recommended to use a virtual environment (venv).
|
|
97
|
+
|
|
98
|
+
## Quick Start
|
|
99
|
+
|
|
100
|
+
### 1. Command-Line Interface (CLI)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Display an image in the terminal
|
|
105
|
+
aap-echo my_image.jpg -m full_mode
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Export a video to ASCII (.mp4)
|
|
110
|
+
aap-export my_video.mp4 result.mp4 -l 100
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 2. Python Usageimport ascii_art_python as aap
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
# Convert an image (Hybrid Mode)
|
|
117
|
+
img = aap.full_mode.Image.from_path("photo.jpg", max_size=50_000)
|
|
118
|
+
print(img)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
# Play a video in the terminal (Edge-Detection Mode)
|
|
123
|
+
vid = aap.old_skool.Video("movie.mp4", fps=15)
|
|
124
|
+
vid.print_in_terminal()
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Rendering Modes
|
|
128
|
+
|
|
129
|
+
- New Skool: Density-based (classic shading).
|
|
130
|
+
- Old Skool: Edge-detection based (line art style).
|
|
131
|
+
- Full Mode: Hybrid combining sharp contours and shading.
|
|
132
|
+
|
|
133
|
+
## Full Documentation
|
|
134
|
+
|
|
135
|
+
To check the complete API, class details, and advanced export options, visit: [the doc](https://guill_prieur.site-prieur.fr/ascii-art-python/).
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
Distributed under the MIT License. See LICENSE for more information.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# ASCII Art Python - Convert Images & Videos to Terminal Graphics
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
6
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
7
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
ASCII Art Python is a powerful tool to transform your images and videos into ASCII art. Export your creations as text, images, or videos (with audio) and play them directly in your terminal.
|
|
14
|
+
|
|
15
|
+
## Preview
|
|
16
|
+
|
|
17
|
+
Below is an example of an image featuring the Python logo:
|
|
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
|
+
And below, an example of a video featuring Nyan Cat:
|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install ascii-art-python
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
OpenCV Note: This module uses opencv-python-headless. To avoid conflicts with opencv-python, it is highly recommended to use a virtual environment (venv).
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
### 1. Command-Line Interface (CLI)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Display an image in the terminal
|
|
67
|
+
aap-echo my_image.jpg -m full_mode
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Export a video to ASCII (.mp4)
|
|
72
|
+
aap-export my_video.mp4 result.mp4 -l 100
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 2. Python Usageimport ascii_art_python as aap
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# Convert an image (Hybrid Mode)
|
|
79
|
+
img = aap.full_mode.Image.from_path("photo.jpg", max_size=50_000)
|
|
80
|
+
print(img)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
# Play a video in the terminal (Edge-Detection Mode)
|
|
85
|
+
vid = aap.old_skool.Video("movie.mp4", fps=15)
|
|
86
|
+
vid.print_in_terminal()
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Rendering Modes
|
|
90
|
+
|
|
91
|
+
- New Skool: Density-based (classic shading).
|
|
92
|
+
- Old Skool: Edge-detection based (line art style).
|
|
93
|
+
- Full Mode: Hybrid combining sharp contours and shading.
|
|
94
|
+
|
|
95
|
+
## Full Documentation
|
|
96
|
+
|
|
97
|
+
To check the complete API, class details, and advanced export options, visit: [the doc](https://guill_prieur.site-prieur.fr/ascii-art-python/).
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
Distributed under the MIT License. See LICENSE for more information.
|
|
@@ -12,7 +12,8 @@ import ascii_art_python as aap
|
|
|
12
12
|
@click.argument("target_filename", type=click.STRING)
|
|
13
13
|
@click.option("--length", "-l", default=15_000, help="The number of characters in the output")
|
|
14
14
|
@click.option("--mode", "-m", default="full_mode", help="full_mode / old_skool / new_skool")
|
|
15
|
-
|
|
15
|
+
@click.option("--sound/--no-sound", default=True, help="If the file is a video file, export it with or without audio.")
|
|
16
|
+
def create_and_export(source_path, target_filename, length, mode, sound):
|
|
16
17
|
"""
|
|
17
18
|
Creates and exports an ASCII art image or video.
|
|
18
19
|
"""
|
|
@@ -48,8 +49,12 @@ def create_and_export(source_path, target_filename, length, mode):
|
|
|
48
49
|
else:
|
|
49
50
|
click.secho(f"✗ Error: Mode '{mode}' is not recognized.")
|
|
50
51
|
sys.exit(1)
|
|
51
|
-
video.export(target_filename, sound=
|
|
52
|
+
video.export(target_filename, sound=sound)
|
|
52
53
|
click.echo("✓ Conversion complete!")
|
|
54
|
+
if sound:
|
|
55
|
+
click.echo(f"✓ Your file is available here: {target_filename}_audio.mp4")
|
|
56
|
+
else:
|
|
57
|
+
click.echo(f"✓ Your file is available here: {target_filename}.mp4")
|
|
53
58
|
else:
|
|
54
59
|
click.secho("✗ Error: Unable to determine which export type to use")
|
|
55
60
|
sys.exit(1)
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ascii_art_python
|
|
3
|
+
Version: 1.2.3
|
|
4
|
+
Summary: A Python library and CLI tool for converting images and videos into ASCII art.
|
|
5
|
+
Author-email: Guillem Prieur <prieurguillem38@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python
|
|
7
|
+
Project-URL: Bug Tracker, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python/-/issues
|
|
8
|
+
Project-URL: Source Code, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python
|
|
9
|
+
Project-URL: Documentation, https://guill_prieur.site-prieur.fr/ascii-art-python
|
|
10
|
+
Keywords: ascii,ascii-art,image-to-ascii,video-to-ascii,cli,terminal,terminal-graphics,generator,converter
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
15
|
+
Classifier: Topic :: Multimedia :: Video
|
|
16
|
+
Classifier: Topic :: Terminals
|
|
17
|
+
Classifier: Environment :: Console
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
26
|
+
Classifier: Operating System :: OS Independent
|
|
27
|
+
Requires-Python: >=3.9
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: pillow>=10.0.0
|
|
31
|
+
Requires-Dist: tqdm>=4.65.0
|
|
32
|
+
Requires-Dist: opencv-python-headless>=4.8.0
|
|
33
|
+
Requires-Dist: moviepy>=2.0.0
|
|
34
|
+
Requires-Dist: numpy>=1.24.0
|
|
35
|
+
Requires-Dist: click
|
|
36
|
+
Requires-Dist: importlib_resources; python_version < "3.10"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# ASCII Art Python - Convert Images & Videos to Terminal Graphics
|
|
40
|
+
|
|
41
|
+
<div align="center">
|
|
42
|
+
|
|
43
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
44
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
45
|
+
[](https://pypi.org/project/ascii-art-python/)
|
|
46
|
+
[](https://opensource.org/licenses/MIT)
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
ASCII Art Python is a powerful tool to transform your images and videos into ASCII art. Export your creations as text, images, or videos (with audio) and play them directly in your terminal.
|
|
52
|
+
|
|
53
|
+
## Preview
|
|
54
|
+
|
|
55
|
+
Below is an example of an image featuring the Python logo:
|
|
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
|
+
And below, an example of a video featuring Nyan Cat:
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
## Installation
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install ascii-art-python
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
OpenCV Note: This module uses opencv-python-headless. To avoid conflicts with opencv-python, it is highly recommended to use a virtual environment (venv).
|
|
97
|
+
|
|
98
|
+
## Quick Start
|
|
99
|
+
|
|
100
|
+
### 1. Command-Line Interface (CLI)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Display an image in the terminal
|
|
105
|
+
aap-echo my_image.jpg -m full_mode
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Export a video to ASCII (.mp4)
|
|
110
|
+
aap-export my_video.mp4 result.mp4 -l 100
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 2. Python Usageimport ascii_art_python as aap
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
# Convert an image (Hybrid Mode)
|
|
117
|
+
img = aap.full_mode.Image.from_path("photo.jpg", max_size=50_000)
|
|
118
|
+
print(img)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
# Play a video in the terminal (Edge-Detection Mode)
|
|
123
|
+
vid = aap.old_skool.Video("movie.mp4", fps=15)
|
|
124
|
+
vid.print_in_terminal()
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Rendering Modes
|
|
128
|
+
|
|
129
|
+
- New Skool: Density-based (classic shading).
|
|
130
|
+
- Old Skool: Edge-detection based (line art style).
|
|
131
|
+
- Full Mode: Hybrid combining sharp contours and shading.
|
|
132
|
+
|
|
133
|
+
## Full Documentation
|
|
134
|
+
|
|
135
|
+
To check the complete API, class details, and advanced export options, visit: [the doc](https://guill_prieur.site-prieur.fr/ascii-art-python/).
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
Distributed under the MIT License. See LICENSE for more information.
|
|
@@ -15,4 +15,5 @@ ascii_art_python.egg-info/entry_points.txt
|
|
|
15
15
|
ascii_art_python.egg-info/requires.txt
|
|
16
16
|
ascii_art_python.egg-info/top_level.txt
|
|
17
17
|
ascii_art_python/assets/fonts/GoogleSansCode-Regular.ttf
|
|
18
|
-
ascii_art_python/assets/fonts/KreativeSquareSM.ttf
|
|
18
|
+
ascii_art_python/assets/fonts/KreativeSquareSM.ttf
|
|
19
|
+
docs/example.gif
|
|
Binary file
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ascii_art_python"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.3"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Guillem Prieur", email="prieurguillem38@gmail.com" },
|
|
10
10
|
]
|
|
@@ -57,6 +57,7 @@ dependencies = [
|
|
|
57
57
|
"Homepage" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python"
|
|
58
58
|
"Bug Tracker" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python/-/issues"
|
|
59
59
|
"Source Code" = "https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python"
|
|
60
|
+
"Documentation" = "https://guill_prieur.site-prieur.fr/ascii-art-python"
|
|
60
61
|
|
|
61
62
|
[project.scripts]
|
|
62
63
|
aap-export = "ascii_art_python.cli:create_and_export"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
recursive-include ascii_art_python/assets/fonts *
|