aisk/pic2ascii

I've found a bug when process the bitmap with only white and black pixels

neo5anderson opened this issue · 3 comments

have a look at newest pic2ascii.py at line 19
I think:

    output += chars[(pixs[x,y]/10) % len(chars)]

will be much better than:

    output += chars[pixs[x,y]/10]

Because when I convert my pics, I always got:

IndexError: string index out of range

Here is my test image:
c

aisk commented

Sorry late for the reply for seven years, seems I saw this issue and forgot to reply. Actually this problem seems can not reproduced on my machine with current pillow version (so many versions released after senven years...). Looks like they changed the behavior with some release. Please contact me if you got any issue now, I think I have more knowledges on fix bugs in these years.

And thanks for the patient for waiting seven years.

捕获