Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -19,14 +19,14 @@ def convert_to_ascii(image, text_size):
|
|
19 |
resized_image = gimage.resize((new_width, new_height))
|
20 |
grayscale_image = resized_image.convert('L')
|
21 |
|
22 |
-
ascii_chars = 'β@&%#*β+=-:,.\/|][}{)(
|
23 |
|
24 |
ascii_image = ''
|
25 |
for y in range(new_height):
|
26 |
for x in range(new_width):
|
27 |
pixel_value = grayscale_image.getpixel((x, y))
|
28 |
if pixel_value == 255: # make sure to use the GOD DAM transparency
|
29 |
-
ascii_image += ' '
|
30 |
else:
|
31 |
ascii_image += ascii_chars[int(pixel_value / 255 * (len(ascii_chars) - 1))]
|
32 |
ascii_image += '\n'
|
|
|
19 |
resized_image = gimage.resize((new_width, new_height))
|
20 |
grayscale_image = resized_image.convert('L')
|
21 |
|
22 |
+
ascii_chars = 'β@&%#*β+=-:,.\/|][}{)(Β΄ββββββ ' # add more characters if you want
|
23 |
|
24 |
ascii_image = ''
|
25 |
for y in range(new_height):
|
26 |
for x in range(new_width):
|
27 |
pixel_value = grayscale_image.getpixel((x, y))
|
28 |
if pixel_value == 255: # make sure to use the GOD DAM transparency
|
29 |
+
ascii_image += 'β '
|
30 |
else:
|
31 |
ascii_image += ascii_chars[int(pixel_value / 255 * (len(ascii_chars) - 1))]
|
32 |
ascii_image += '\n'
|