peasoup commited on
Commit
0a7504b
Β·
1 Parent(s): a75b059

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 = 'β–ˆ@&%#*β–‘+=-:,.\/|][}{)(Β΄β€žβ€Ÿβ€šβ€›β€˜ ' # 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'
 
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'