Skip to content

Commit 132c1c9

Browse files
committed
Update README
1 parent 727064f commit 132c1c9

File tree

5 files changed

+72
-12
lines changed

5 files changed

+72
-12
lines changed

README.md

+72-12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,77 @@
33
An ascii art generator that's actually good.
44
Does edge detection and selects the most appropriate characters.
55

6+
7+
<p align="center">
8+
<img src="./rsrc/skykid.png" alt = "Blue Tit">
9+
</p>
10+
11+
<p align="center">
12+
<img src="./rsrc/bluetit.png" alt = "Blue Tit">
13+
</p>
14+
15+
<p align="center">
16+
<img src="./rsrc/niko.png" alt = "Niko from oneshot!">
17+
</p>
18+
19+
## Installing
20+
21+
### Installing with pip:
22+
23+
```
24+
pip install asciiartist
25+
```
26+
27+
### Installing from wheel:
28+
29+
Download the wheel file from this project's releases and run
30+
31+
```
32+
pip install <path/to/wheel>
33+
```
34+
35+
## Quick Start
36+
37+
```py
38+
from asciiartist import asciiartist, display_edges
39+
from PIL import Image
40+
41+
img = Image.open("niko.png")
42+
43+
art, edges = asciiartist(
44+
img, # The image!
45+
30, # Number of lines of the output ascii art
46+
noise_reduction=3, # Level of noise reduction (optional)
47+
line_weight=1, # Weight of the lines to draw (optional)
48+
text_ratio=2.2 # Height/width ratio of each character (optional)
49+
)
50+
51+
print(art) # `art` is a string u can just print
52+
53+
# v Display the result of edge detection.
54+
# Good for finetuning params.
55+
display_edges(edges)
56+
```
57+
58+
## Build from Source
59+
60+
Run the script `./model/model-gen.py` and build the wheel with `poetry build -f wheel`.
61+
62+
## How it works
63+
64+
Roughly, how _Ascii Artist_ generates the drawings:
65+
66+
1. Run edge detection
67+
2. Segment the image for each char
68+
3. Pass each segment through a [CNN](https://en.wikipedia.org/wiki/Convolutional_neural_network) to get the most appropriate character.
69+
70+
The CNN is trained with distorted images of characters (in font consolas),
71+
created in a way that emulates the output of the edge detection.
72+
73+
## Bye
74+
75+
^-^
76+
677
```
778
_.C\=-C`~(
879
```o''*~C` `,
@@ -27,15 +98,4 @@ Does edge detection and selects the most appropriate characters.
2798
-*``ELU-,*UF-~o_@o,_
2899
___-~-`'`````` `` `''`````````[\ ``'
29100
___-=-*'``` ___ U, --oIoE/ `,
30-
```
31-
32-
## Installation and Usage
33-
34-
### Installing using Pip
35-
36-
```
37-
pip install asciiartist
38-
```
39-
40-
## How it works
41-
101+
```

rsrc/bluetit.jpg

-152 KB
Binary file not shown.

rsrc/bluetit.png

9.21 MB
Loading

rsrc/niko.png

8.18 MB
Loading

rsrc/skykid.png

3.12 MB
Loading

0 commit comments

Comments
 (0)