AsciiArtBotA bot to make REALLY COOL ascii arts(images made out of text)!
The simplest example of using the bot is this:
attach image to the message
receive an Ascii Art in a .txt file which will be automatically previewed in Discord
press "Expand" to view the full txt document The Ascii Art is ready! But there are additional features you should use to get a quality Ascii Art.
- Simple character palette
Just type "asc!ascArt simple" instead of "asc!ascArt" and you get a brand new simpler character palette! It is more suitable for cartoony/pixelated images.
- Invert image
Just type "invert" after the command with a space (eg. "asc!ascArt invert" or "asc!ascArt simple invert") to invert the image. It's self-explanatory, can be used to make viewing ascii arts in dark mode better.
- Set size limit
Type "limit=N" without spaces around = and a number (further referenced as N). It will make so that the image will fit in a N*2 by N size. Basically, for square images it will resize it to N by N. Play around with it to understand more.
To explain this easier to pythonistas, PIL and its thumbnail function is used. See https://stackoverflow.com/questions/29367990/what-is-the-difference-between-image-resize-and-image-thumbnail-in-pillow-python for more.
- Phone mode
I woke up and I decided to check if .txt files are previewed on phones. It turns out they are not! So I opened replit.com on my phone, in bed, and coded up this feature.
So, basically, I made a phone mode. Just write "phone" after the command. Key differences from default mode:
I. The ascii art is not in a file, it's formatted as code in Discord, so you can view it immediately. But now we have a 2000 character limit...
II. So, to bypass the 2000 char limit, the default image size limit in this mode is 30. The maximum acceptable limit in this case is 31, but I decided 30 is nicer. If you set the limit to more than 31, you will not get your ascii art.
In phone mode, resulting ascii arts can be really low-res, so I recommend not using it or use it only with images less than 32x32 pixels.