File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
- # Original script by @atluft with inspiration from http://link.medium.com/0D6TnUKTIab located at:
3
+ # Original script by @atluft with inspiration from http://link.medium.com/0D6TnUKTIab located at: # noqa: E501
4
4
# https://github.com/o2sh/onefetch/wiki/ASCII-Art-From-Image-Using-Python-Image-Library/9c454b390273ffedd60db9d525fb001f89d581b1
5
5
6
6
# lint with
7
- # flake8 --max-line-length 120 image_to_ascii.py
7
+ # flake8 --max-line-length 88 image_to_ascii.py
8
8
# black --color --diff image_to_ascii.py
9
9
# isort --color --diff image_to_ascii.py
10
10
17
17
18
18
parser = ArgumentParser (description = "convert an image file to ASCII art" )
19
19
requiredNamed = parser .add_argument_group ("required argument" )
20
+ requiredNamed .add_argument (
21
+ "-c" ,
22
+ "--characters" ,
23
+ help = 'characters available to be used, default " .:_-"' ,
24
+ default = " .:_-" ,
25
+ )
20
26
requiredNamed .add_argument (
21
27
"-f" ,
22
28
"--file" ,
61
67
62
68
63
69
def getSomeChar (h ):
64
- chars = "-_:. " [::- 1 ]
65
- charArr = list (chars )
70
+ charArr = list (args .characters )
66
71
mul = len (charArr ) / 256
67
72
return charArr [floor (h * mul )]
68
73
You can’t perform that action at this time.
0 commit comments