Skip to content

Commit 2510803

Browse files
author
ProfOak
committed
Updated readme, density function fix
1 parent 1ff85dd commit 2510803

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

Media/density.jpg

65.3 KB
Loading

Media/terminal.jpg

529 KB
Loading

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,52 @@
22

33
Makin some pictures
44

5-
This library requires the Pillow library
5+
This library requires the Pillow and colorama libraries
66

7-
`pip install -U Pillow`
7+
`python3 -m pip install -U Pillow colorama`
88

99
To use the gui you need PySide
1010

11-
`pip install -U PySide`
11+
`python3 -m pip install -U PySide`
1212

13-
See `main.py` for basic usage
13+
At the time of this commit PySide can only be installed on Python versions 2.6, 2.7, 3.3, 3.4. If you wish to use the GUI you must have installed versions 3.3 or 3.4. You can read more about it here https://github.com/PySide/pyside-setup/issues/53
1414

15-
Basic usage
1615
---
1716

18-
Before:
17+
Usage: main.py [options]
18+
19+
Options:
20+
-h, --help show this help message and exit
21+
-o FILENAME, --out=FILENAME
22+
The filename you want your final image saved as
23+
-w WORDS, --words=WORDS
24+
Use words to create your image
25+
-s STEP, --step=STEP Choose the distance of your characters
26+
-d, --density Adding the flag converts the image based on visual
27+
density
28+
-t, --terminal Print ascii image to terminal
29+
30+
31+
Example usage
32+
---
33+
34+
Original image:
1935

2036
![](https://raw.githubusercontent.com/ProfOak/ascii_py/master/Media/before.jpg)
2137

22-
After:
38+
Default usage:
2339

2440
![](https://raw.githubusercontent.com/ProfOak/ascii_py/master/Media/after.jpg)
2541

42+
Density flag:
43+
44+
![](https://raw.githubusercontent.com/ProfOak/ascii_py/master/Media/density.jpg)
45+
46+
Terminal flag (screenshot):
47+
48+
![](https://raw.githubusercontent.com/ProfOak/ascii_py/master/Media/terminal.jpg)
2649

27-
Flag usage example
50+
Other flags usage example:
2851
---
2952

3053
`$ python main.py -s 10 -w "dank memes" -o ayy_lmao_pizza.jpg Media/pizza_in.jpg`

ascii.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def __init__(self, in_file):
1313
self.from_pic = Image.open(in_file)
1414
self.to_pic = Image.new("RGB", self.from_pic.size, "black")
1515
self.draw = ImageDraw.Draw(self.to_pic)
16-
self.draw = ImageDraw.Draw(self.to_pic)
1716

1817
self.MAX_W, self.MAX_H = self.from_pic.size
1918

@@ -61,6 +60,9 @@ def density_artify(self, step=7):
6160
h = 0
6261
w = 0
6362

63+
# used for brightness (density) levels
64+
grayscale_img = self.from_pic.convert("L")
65+
6466
while h < self.MAX_H:
6567
while w < self.MAX_W:
6668
# get brightness value

0 commit comments

Comments
 (0)