This library can create and transform unicode-art made up of braille characters. It can create an art string using 3 different dithering algorithms and invert, rotate and mirror any given unicode-braille-art string.
Dependencies: Pillow Image module
Include braillecrate.py to include functions to create braille-art, brailletransform.py includes functions to transform existing braille-art strings. Both files need the brailledata.py file to operate.
All three usable functions in this file use the same parameters:
(picture, color_treshold=128, line_delimiter='\n', dot_for_blank=True, fill_transparency=True, width=0, height=0)
picture
- An image object.color_treshold
- A value between 0 and 255. If the result looks bad, changing up this value could help.line_delimiter
- The character between two lines.dot_for_blank
- If set, replaces this braille character: "⠀" with this: "⠄".fill_transparency
- If set, fills full transparency.width
- The width of the picture, also the width of the result string in pixels. If 0, the actual width of the picture is used.height
- The height of the picture, same rules as width.
Using treshold_dithering(pic, 145, width=100, height=100)
:
⣹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠄⠜⠁⠄⠄⠄⠄⠄⠄⠐⠇⠘⠿⣿⣿⠄⠄⠄⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣩⣵⢀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠉⠄⠄⠄⠄⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏⣸
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⢼⡇
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢻⣿⣿⣿⣿⣿⣿⣿⣿⣷⣾⢇
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠹⣿⣿⣿⣿⡟⠛⢿⡿⠿⡸
⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣀⣀⣀⣀⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣀⡤⠟⢿⡿⠟⠁⠄⠈⠡⠊⡇
⡹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣀⡀⠄⠄⠄⠄⠄⠄⠘⠻⢿⣿⠿⠿⠛⠛⠂⠄⠄⠄⠄⢀⣠⣴⠞⠋⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡇
⡇⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⣿⣿⣦⣴⣆⠄⠄⠄⠄⡞⢀⣠⣤⣤⣤⣄⡀⠠⠠⠾⠟⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣦⢠⠃
⠇⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣥⣤⣤⣤⣼⣿⣿⣿⠟⠄⠄⢤⡈⠻⠿⠟⠛⠋⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡇⠄⠄
⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⣿⣿⣿⣿⠄⠄⠄⠈⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢠⣧⢠⡆
⠳⠞⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣸⣿⢸⡇
⠄⠘⢡⣙⣿⣿⣿⣿⣿⣿⣏⠉⠉⠉⠹⣿⣿⣿⣿⠆⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢰⣿⣿⢸⡆
⠄⠄⢸⢱⠿⣿⣿⣿⣿⣿⡇⠄⠄⠄⢀⣿⣿⣿⣿⡆⠄⠄⠄⠄⠄⠄⠄⠻⣷⣄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣠⣼⣿⡿⠾⠧
⠄⠄⠄⢸⠐⣿⣿⣿⣿⣿⡇⠄⠄⠄⢸⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠙⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢻⣿⣿⣿⣶⣯
⠄⠄⠄⢸⢠⢻⣿⣿⣿⣿⣧⠄⠄⠄⠈⣿⣿⣿⣿⣷⡄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠹⣿⣿⣿⣿
⠄⠄⠄⠈⣾⠈⣿⣿⣿⣿⣿⡇⠄⠄⠄⣿⣿⣿⣿⡟⠁⠄⠄⠄⠄⣀⣀⡀⠄⠄⠄⠄⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠹⣿⣿⣿
⠄⠄⠄⠄⢸⣤⢹⣿⣿⣿⣿⣿⡦⠄⠄⢿⣿⣿⣿⣿⣿⡿⠿⠗⠄⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢹⣿⣿
⠄⠄⠄⠄⠄⠿⡘⣿⣿⣿⣿⣿⣄⠄⠄⠈⢿⣿⣿⣿⣇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢸⣿⣿
⠄⠄⠄⠄⠄⠄⡇⣼⣿⣿⣿⣿⣿⣧⠄⠄⢺⣿⣿⣿⡿⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣾⣿⣿
⠄⠄⠄⠄⠄⠄⠄⡇⡼⣿⣿⣿⣿⣿⣷⣶⣾⣿⡿⠛⢁⣠⡄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢰⣿⣿⣿
⠄⠄⠄⠄⠄⠄⠄⠘⡗⡺⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣾⡟⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢠⣿⣿⣿⣿
⠄⠄⠄⠄⠄⠄⠄⢀⡸⠷⣹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⣾⣿⣿⣿⣿
⠄⠄⠄⠄⠄⣠⡒⣢⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⣾⣿⣿⣿⣿⣿
⠄⠄⢠⠘⢛⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣠⣾⣿⣿⣿⣿⣿⣿
⢠⡜⢰⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿
Using ordered_dithering(pic, width=100, height=100)
:
⡩⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡪⡫⡯⡫⡪⡢⡪⡂⡂⡂⡂⡂⡂⡂⡪⡪⡪⡪⡪⡪⡂⡂⠂⡪⡪⡪⡪⡪⡪⡪⡪⡪⡪⡪⡫⡩⡵⢀
⡮⡯⡯⡯⡯⡯⡯⡯⡯⡫⡪⡪⡪⡪⡊⡊⡂⡂⡂⡂⡂⡂⡂⡂⠄⠂⠂⠂⠂⠂⠂⠊⠂⠂⡂⡂⡪⡪⡪⡪⡪⡪⡪⡪⡪⡪⡪⡪⡊⣨
⡯⡯⡯⡯⡯⡯⡯⡯⡫⡪⡪⡊⡊⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⠂⠄⠄⠄⠄⠄⠄⠄⠄⠄⠂⠂⡪⡪⡯⡮⡮⡯⡯⡯⡪⡪⣦⢬⡇
⡯⡯⡯⡯⡯⡯⡯⡪⡪⡪⡪⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⠂⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠊⡪⡯⡯⡯⡫⡪⡫⡯⡪⡢⡮⠦
⡯⡯⡯⡯⡯⡯⡫⡪⡪⡪⡪⡊⡂⡂⡂⡂⠄⠄⡂⡂⡂⡂⡀⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠪⡫⡯⡯⡮⡊⡋⡫⡮⠪⡨
⠫⡯⡯⡯⡯⡯⡪⡪⡪⡪⡪⡢⡂⡂⡂⡂⡂⠄⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡀⠄⠄⠄⠄⡀⡢⡊⡫⡫⡋⠊⡢⡊⡢⠊⡂
⡩⡯⡯⡯⡯⡯⡯⡮⡪⡪⡪⡪⡢⡂⡂⡂⡂⡂⡂⡂⡂⡪⡪⡪⡪⡪⡪⡊⡊⠂⡂⡂⠂⠂⡀⡠⡢⡊⠊⠄⡀⡂⠂⠄⠄⡊⡂⡂⠠⡂
⡇⠨⡯⡯⡯⡯⡯⡯⡮⡮⡮⡯⡫⡫⡪⡪⡢⡪⡢⡂⡀⠄⡪⡪⡂⡢⡢⡢⡢⡢⡂⡂⡂⡪⡊⠊⠄⠄⠄⠄⡂⠄⡢⡂⡀⠄⡂⣢⠠⠂
⡇⡮⡯⡯⡯⡯⡯⡯⡯⡯⡪⡢⡢⡢⡢⡪⡮⡯⡮⡊⡂⠂⡢⡊⡪⡪⡪⡋⡋⡂⠄⡀⡂⠄⠄⠄⠄⠄⡀⠄⠂⡂⠊⡊⡂⡂⠂⡃⠄⠂
⡆⡫⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡫⡊⡪⡫⡯⡯⡂⡂⠄⠊⡂⡂⡂⡂⡂⡂⡂⡂⠄⠄⠄⠄⠄⠄⠄⡂⠄⠄⠂⡂⡂⠂⠄⡢⣧⠠⡆
⠲⠎⠯⡯⡯⡯⡯⡯⡫⡪⡫⡪⡪⡪⡪⡪⡪⡯⡯⡂⠄⠄⠄⠄⠄⠂⡂⡂⡂⡂⡂⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡂⡂⠄⠄⡪⣿⠨⡂
⠄⠘⠡⣉⡯⡯⡯⡯⡪⡪⡪⡪⡪⡪⡪⡪⡪⡪⡪⡂⡂⠄⠄⠄⠄⠄⡢⡂⡂⡂⡂⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠂⡂⠄⡢⡮⣿⠨⡆
⠄⠄⢨⠱⠮⡯⡯⡯⡯⡪⡊⡂⡂⡂⡪⡪⡮⡯⡪⡂⡂⠄⠄⠄⠄⠄⡊⡪⡪⡢⡂⡂⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡂⡠⡪⡯⡺⠮⠧
⠄⠄⠄⢨⠐⡯⡯⡯⡯⡪⡪⡂⡂⡂⡪⡫⡯⡮⡪⡂⡂⠄⠄⠄⠄⠂⠄⠄⡊⡪⡪⡂⡂⡂⠄⠄⠄⠄⠄⠄⠄⠄⡂⡀⡪⡯⡯⡮⡦⡯
⠄⠄⠄⢸⠠⠪⡯⡯⡯⡯⡪⡂⡂⡂⡪⡪⡪⡫⡯⡮⡢⡂⡂⡂⡂⡀⠄⠄⠂⠂⡂⡂⡂⡂⠄⠄⠄⠄⠄⠄⠄⡂⡂⡂⡂⡪⡿⡯⡯⡯
⠄⠄⠄⠈⡮⠈⡯⡯⡯⡯⡮⡪⡂⡂⡂⡪⡪⡪⡪⡪⡊⡂⡂⡂⡂⡂⡀⡂⡂⡂⠂⡊⡪⡂⠄⠄⠄⠄⠄⠄⡂⡂⡂⡂⡂⡂⡪⡿⡯⡯
⠄⠄⠄⠄⢸⣤⠪⡯⡯⡯⡯⡪⡢⡂⡂⡪⡪⡮⡮⡮⡮⡮⡪⡊⡊⠊⠂⠄⠄⠄⠄⠂⡂⡂⠄⠄⠄⠄⡀⡂⡂⡂⡂⡂⡂⡂⡂⡪⡯⡯
⠄⠄⠄⠄⠄⠿⡈⡫⡯⡯⡯⡮⡪⡂⡂⡊⡪⡫⡫⡯⡪⡂⡂⡂⡂⡂⠄⠄⠄⠄⠄⠄⠄⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡪⡮⡯
⠄⠄⠄⠄⠄⠄⡃⣬⡫⡯⡯⡯⡮⡢⡂⡂⡪⡪⡪⡫⡫⡂⡊⡂⡂⡂⡂⡀⡀⡀⠄⠄⠄⠄⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡪⡯⡯
⠄⠄⠄⠄⠄⠄⠄⡃⡬⡯⡯⡯⡯⡯⡮⡢⡪⡪⡪⡊⡪⡢⡢⡂⡂⡂⡂⡂⡂⠄⠄⠄⡀⡀⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡪⡮⡯⡯
⠄⠄⠄⠄⠄⠄⠄⠘⡗⡪⡯⡯⡯⡯⡯⡯⡯⡪⡪⡢⡪⡪⡂⡂⡂⡂⡂⡂⠄⠄⠄⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡢⡪⡯⡯⡯
⠄⠄⠄⠄⠄⠄⠄⢀⡸⠷⡨⡯⡯⡯⡯⡯⡯⡯⡮⡪⡪⡪⡂⡂⡂⡂⡂⡂⡀⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡪⡯⡯⡯⡯
⠄⠄⠄⠄⠄⡠⡂⡢⡤⡮⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡮⡮⡪⡢⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡪⡯⡯⡯⡯⡯
⠄⠄⢠⠘⠛⡠⡮⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡪⡪⡊⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡢⡮⡯⡯⡯⡯⡯⡯
⢠⡜⠠⡮⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡯⡮⡪⡢⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡂⡢⡪⡮⡯⡯⡯⡯⡯⡯⡯
Using floyd_steinberg_dithering(pic, width=100, height=100)
:
⣹⣽⣿⣿⣿⣿⢿⣻⣽⢯⢯⡳⡽⢵⡻⡕⡇⢕⢜⢐⠐⡐⢐⠠⢑⠐⢅⢇⠪⡺⡸⡪⡂⡢⠘⢜⢜⢼⢱⢳⣣⢳⢹⡪⣗⢽⢽⢩⢵⢀
⣿⣾⣿⣷⣿⣾⡿⣽⣞⢽⡱⡝⢮⢫⠪⠨⡈⠢⢁⠐⠄⢂⠐⠐⡀⠌⠐⡀⠅⠐⠈⠌⠂⠄⠅⠢⢹⢸⢕⣕⢕⢯⢮⡺⣪⡳⡯⡯⡇⣸
⣿⣯⣷⣿⡾⣟⣯⡗⡗⡕⡕⡑⠅⢅⢊⠐⠄⡑⠠⢁⠌⠄⠌⠄⠐⡀⢁⠠⠄⡁⢈⠄⠡⠄⠅⡈⠢⡱⣕⣯⣯⣯⡿⣽⣞⢮⢯⣇⢬⡇
⣿⣿⣯⣷⣟⣟⢗⡽⡸⡸⡨⡊⢌⢂⠂⠌⡐⠠⢑⠐⡠⢁⠂⡁⠐⠄⡀⠠⠄⠄⠄⠂⠁⠐⡀⢐⠠⠈⢎⢾⣞⣗⣝⠼⡽⣯⢞⣖⡾⢤
⣿⣷⡿⣷⢷⢽⢕⡯⣪⡪⡪⡘⢔⠠⢁⠅⠠⠈⡐⡐⡀⢂⠠⠐⠈⠄⠠⠄⠂⡀⢁⠈⡀⠁⠄⠠⠐⢈⠐⠱⣹⣳⢷⡯⡫⠊⡻⡮⠯⡸
⢻⣯⣿⣿⣝⢷⢝⡮⡇⣗⢕⢕⠡⠨⡀⢂⠂⠁⠄⡂⡐⢄⢂⡢⡡⡂⡢⡨⡐⠠⢂⢐⠄⠅⠠⠁⠈⡀⡄⡕⢕⢫⠯⠣⠃⠕⡌⠺⠐⠅
⡹⣽⢿⣾⡽⡽⣝⡮⣫⡪⣎⡎⣎⡢⡂⡂⡂⠡⡁⡂⠌⡪⠪⡪⡪⢎⠗⠕⠕⠕⠡⡀⠅⠁⡂⣅⢮⠺⠘⠈⠠⢂⠡⠁⠨⠨⠨⡊⠄⡇
⡇⠸⣿⣿⣽⢽⣳⣽⣺⡺⡮⡯⢗⠟⡮⡳⣸⡸⡌⢄⠄⡈⢌⢎⢌⢔⢬⢦⣢⢢⢑⠔⡌⡞⠝⠁⢁⠠⠄⠅⡁⢂⠢⡡⠈⠄⡑⣦⠰⠄
⠇⢮⣗⣿⣽⣗⣗⣯⣷⣻⡱⣡⢕⣌⣆⢧⣳⣻⡮⡣⠑⠐⡕⢜⠸⡱⡙⡍⠣⠁⢂⠐⠠⠄⠂⢈⠄⡐⢈⠄⡂⠄⢑⠨⡂⡁⢐⠇⠄⠄
⡆⣟⣾⣷⣻⣞⢿⢷⣗⡷⣟⡯⡟⡇⡇⢏⢯⣟⣗⠔⠄⠄⠘⠔⡁⠢⠨⠐⡁⠅⡀⠂⠁⡀⠁⠄⢀⠂⠄⠂⠐⡈⠄⡂⠢⠄⢬⣧⢀⠆
⠳⠖⢟⣾⣳⢯⡯⣗⢗⢝⢵⡣⡣⡣⡪⡣⡯⣞⢮⠊⠄⠐⠄⠐⠄⠁⠅⠌⡐⢐⠄⡁⠄⠐⢀⠈⠠⠐⢈⠠⠁⠄⢂⠄⠡⢈⢜⣾⠸⡀
⠄⠘⢡⣘⣞⡯⣟⡮⣫⡺⡨⡊⡪⡘⢜⢜⢮⢮⡳⡡⠁⠄⠐⠄⡀⢁⢂⠢⡐⠠⠐⠄⠠⠐⠄⠄⢁⠐⠠⠐⠐⠈⠄⢂⠁⢸⡺⣾⠨⡆
⠄⠄⢨⢑⠾⣝⣗⡯⣗⡕⡕⠌⠔⡈⡢⣣⣯⢗⣇⠇⡀⠈⡀⠂⠄⡀⠌⠕⡕⡕⡈⡐⢀⠂⠐⢈⠠⢀⠡⢈⠨⠄⠅⢂⢔⡵⣯⡻⠖⠧
⠄⠄⠄⢘⠐⣳⢯⢯⣗⡇⡇⢕⠡⢊⢜⢵⢯⡳⣕⠕⡀⠄⠄⠄⠁⠄⠄⠂⠌⠪⡊⢆⠢⠠⠁⠄⢂⠠⠐⠠⠐⡈⢐⠐⢝⣿⣷⣻⣶⢽
⠄⠄⠄⢸⠠⢫⢿⢽⣺⣺⢸⠠⡑⡐⢌⢎⢗⢽⣳⡳⡐⠄⢅⢊⠐⡈⢀⠁⠌⠐⡈⡢⡡⠡⢈⠐⠠⠐⢈⢀⢂⢐⠐⠨⢐⠸⣿⣿⣿⣿
⠄⠄⠄⠈⡾⠈⢯⣟⣞⣗⡗⡕⡡⢊⠔⡕⡽⣕⢵⠩⡊⠌⢂⢂⢡⢠⢠⢂⠢⢁⠢⠊⢜⢈⠠⠄⠅⡈⠄⡀⡂⡐⠈⢌⢐⠌⠜⣿⣿⣿
⠄⠄⠄⠄⢸⣤⢹⣞⣗⣟⣞⢜⢌⠆⢕⢱⢝⣮⢾⡼⡮⡺⢪⠢⠃⠌⠠⠁⢈⠄⠄⠡⢁⠂⡐⠈⠄⡐⢀⠂⠔⠠⠑⡐⡐⠌⠌⡪⣻⣿
⠄⠄⠄⠄⠄⠽⢸⣺⣗⣟⢾⣕⠥⡑⡐⡡⡫⡺⡽⣝⢬⢐⠡⡐⡐⢐⠠⠈⠠⠐⢀⠁⢂⠡⠠⢁⢂⠐⠄⠅⡡⠁⠅⡂⢌⠌⡐⡱⡽⣽
⠄⠄⠄⠄⠄⠄⡃⣜⢾⣽⣳⢽⣳⡱⡐⡐⡕⡕⡝⡮⡣⡃⢕⠐⠌⠄⡐⢈⠐⡈⠠⢈⠠⠐⡈⠄⡐⠨⢈⠔⠠⡁⠅⡂⢅⠌⠔⣕⣿⣿
⠄⠄⠄⠄⠄⠄⠄⡇⡜⡾⣯⣟⣞⡷⣕⡵⣸⢸⢸⢘⠌⡆⡅⡣⠡⢁⠂⡂⢂⠐⢈⠠⠐⢐⠐⡐⠠⢑⠐⠨⢐⠠⡁⠢⠡⠨⡪⣺⣿⣾
⠄⠄⠄⠄⠄⠄⠄⠘⡗⡚⣷⣻⢷⣻⣗⣿⣺⣪⡪⡢⡣⡣⡑⡐⡁⡂⢂⠐⡀⢂⠐⠠⡁⡂⡂⡂⠅⠢⠨⠨⢐⢐⠨⠨⠨⡊⣞⣿⣟⣾
⠄⠄⠄⠄⠄⠄⠄⢀⡸⠷⣸⣽⢿⡽⣾⣳⣟⣾⣺⡪⣎⢎⠢⡂⡂⡂⡂⡐⡀⡂⢌⢂⢂⢂⠂⠄⠅⠅⠅⡑⡐⡐⠨⡈⠢⡵⣿⣟⣯⣿
⠄⠄⠄⠄⠄⣠⡒⢂⣤⣷⣿⣿⣯⡿⣽⣾⣳⣟⣾⣞⣮⣳⢕⡌⡢⡂⣂⠢⡂⡪⠐⡐⡐⡐⠨⠨⠨⡈⡂⡂⠢⡈⡢⢘⡼⣿⣟⣯⣿⢾
⠄⠄⢠⠘⢛⢤⣺⣿⣿⣿⡿⣿⣿⣽⢷⣻⣾⣳⣟⣾⣳⡯⣟⣞⢮⢎⠖⢅⠕⡠⠡⢂⠢⢨⠨⢊⠌⡐⡐⠌⠌⢔⢨⣮⣿⣿⣽⢿⡾⣿
⢠⡜⠰⣮⣿⣿⣿⣿⣿⣷⣿⣿⣿⣯⡿⣽⢾⡷⣟⣾⣳⢿⡽⣮⣳⡱⡱⡑⢌⠢⡑⢅⢊⠢⡡⡑⠌⢔⠨⡨⡊⡮⣾⣟⣷⡿⣾⢿⣻⣿
Most functions in this file use these parameters:
(input_str, line_delimiter='\n', dot_for_blank=False)
input_str
- The braille-art string to be transformed.line_delimiter
- The character between two lines. (This parameter doesnt exist for the invert function because it keeps the delimiter of the input string)dot_for_blank
- If set, replaces this braille character: "⠀" with this: "⠄".
Input string:
⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠉⠉⠉⠉⠋⠉⠉⠙⠛⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⠿⠋⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠉⠻⣿⣿⣿⣿⣿
⣿⣿⡟⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠙⢻⣿⣿⣿
⣿⠏⠄⠄⠄⠄⠄⠄⠄⠄⢀⣔⢤⣄⡀⠄⡄⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⢻⣿⣿
⠏⠄⠄⠄⠄⠄⠄⠄⢀⣀⣨⣵⣿⣿⣿⣿⣧⣦⣤⣀⣿⣷⡐⠄⠄⠄⠄⠄⢿⣿
⠄⠄⠄⠄⠄⠄⠐⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠄⠄⠄⢚⣿
⣆⠄⠄⠄⠄⠄⠄⢻⣿⣿⣿⣿⡿⠛⠛⠛⠛⣿⢿⣿⣿⣿⡿⢟⣻⣄⣤⣮⡝⣿
⣿⠆⠄⠄⠄⠄⠄⠄⠄⠄⠉⠘⣿⡗⡕⣋⢉⣩⣽⣬⣭⣶⣿⣿⣿⣿⣝⣻⣷⣿
⣿⣦⡀⠄⠄⠠⢀⠄⠄⠁⠄⠄⣿⣿⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⣿
⣿⣿⣿⡆⠄⠄⠰⣶⡗⠄⠄⠄⣿⣿⣿⣿⣦⣌⠙⠿⣿⣿⣿⣿⣿⣿⣿⡛⠱⢿
⣿⣿⣿⣿⡀⠄⠄⠿⣿⠄⠄⠄⠨⡿⠿⠿⣿⣟⣿⣯⣹⣿⣿⣿⣿⣿⣿⣿⣦⡀
⣿⣿⣿⣿⣷⠄⠄⠄⢷⣦⠄⠄⠐⢶⢾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇
⣿⣿⣿⣿⣿⣧⡄⠄⠄⠉⠄⠄⠄⢉⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠄
⣿⣿⣿⣿⣿⠟⠋⠄⠄⠄⠄⠄⠄⠈⠛⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠄⠄
⣿⠿⠛⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠘⠿⢿⣿⣿⣿⣿⣿⠿⠋⠄⠄⠄⠄
can be inverted to this:
⠄⠄⠄⠄⠄⠄⠄⢀⣠⣤⣶⣶⣶⣶⣴⣶⣶⣦⣤⣤⣄⣀⡀⠄⠄⠄⠄⠄⠄⠄ ⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣶⣶⣶⣶⣴⣶⣶⣦⣤⣤⣄⣀⡀⠀⠀⠀⠀⠀⠀⠀
⠄⠄⠄⠄⣀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣄⠄⠄⠄⠄⠄ ⠀⠀⠀⠀⣀⣴⣾⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣷⣶⣄⠀⠀⠀⠀⠀
⠄⠄⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡄⠄⠄⠄ ⠀⠀⢠⣾⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣦⡄⠀⠀⠀
⠄⣰⣿⣿⣿⣿⣿⣿⣿⣿⡿⠫⡛⠻⢿⣿⢻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠄⠄ ⠀⣰⣻⣻⣻⣻⣻⣻⣻⣻⡿⠫⡛⠻⢿⣻⢻⢿⣻⣻⣻⣻⣻⣻⣻⣻⣻⡄⠀⠀
⣰⣿⣿⣿⣿⣿⣿⣿⡿⠿⠗⠊⠄⠄⠄⠄⠘⠙⠛⠿⠄⠈⢯⣿⣿⣿⣿⣿⡀⠄ ⣰⣻⣻⣻⣻⣻⣻⣻⡿⠿⠗⠊⠀⠀⠀⠀⠘⠙⠛⠿⠀⠈⢯⣻⣻⣻⣻⣻⡀⠀
⣿⣿⣿⣿⣿⣿⣯⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠙⢿⣿⣿⣿⡥⠄ ⣻⣻⣻⣻⣻⣻⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣻⣻⣻⡥⠀
⠹⣿⣿⣿⣿⣿⣿⡄⠄⠄⠄⠄⢀⣤⣤⣤⣤⠄⡀⠄⠄⠄⢀⡠⠄⠻⠛⠑⢢⠄ ⠹⣻⣻⣻⣻⣻⣻⡄⠀⠀⠀⠀⢀⣤⣤⣤⣤⠀⡀⠀⠀⠀⢀⡠⠄⠻⠛⠑⢢⠀
⠄⣹⣿⣿⣿⣿⣿⣿⣿⣿⣶⣧⠄⢨⢪⠴⡶⠖⠂⠓⠒⠉⠄⠄⠄⠄⠢⠄⠈⠄ ⠀⣹⣻⣻⣻⣻⣻⣻⣻⣻⣶⣧⠀⢨⢪⠴⡶⠖⠂⠓⠒⠉⠀⠀⠀⠀⠢⠄⠈⠀
⠄⠙⢿⣿⣿⣟⡿⣿⣿⣾⣿⣿⠄⠄⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢠⠄ ⠀⠙⢿⣻⣻⣟⡿⣻⣻⣾⣻⣻⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠀
⠄⠄⠄⢹⣿⣿⣏⠉⢨⣿⣿⣿⠄⠄⠄⠄⠙⠳⣦⣀⠄⠄⠄⠄⠄⠄⠄⢤⣎⡀ ⠀⠀⠀⢹⣻⣻⣏⠉⢨⣻⣻⣻⠀⠀⠀⠀⠙⠳⣦⣀⠀⠀⠀⠀⠀⠀⠀⢤⣎⡀
⠄⠄⠄⠄⢿⣿⣿⣀⠄⣿⣿⣿⣗⢀⣀⣀⠄⠠⠄⠐⠆⠄⠄⠄⠄⠄⠄⠄⠙⢿ ⠀⠀⠀⠀⢿⣻⣻⣀⠀⣻⣻⣻⣗⢀⣀⣀⠀⠠⠀⠐⠆⠀⠀⠀⠀⠀⠀⠀⠙⢿
⠄⠄⠄⠄⠈⣿⣿⣿⡈⠙⣿⣿⣯⡉⡁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢸ ⠀⠀⠀⠀⠈⣻⣻⣻⡈⠙⣻⣻⣯⡉⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⠄⠄⠄⠄⠄⠘⢻⣿⣿⣶⣿⣿⣿⡶⠂⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣠⣿ ⠀⠀⠀⠀⠀⠘⢻⣻⣻⣶⣻⣻⣻⡶⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣻
⠄⠄⠄⠄⠄⣠⣴⣿⣿⣿⣿⣿⣿⣷⣤⣀⣀⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⣴⣿⣿ ⠀⠀⠀⠀⠀⣠⣴⣻⣻⣻⣻⣻⣻⣷⣤⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣻⣻
⠄⣀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣀⡀⠄⠄⠄⠄⠄⣀⣴⣿⣿⣿⣿⠀⣀⣤⣶⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣻⣧⣀⡀⠀⠀⠀⠀⠀⣀⣴⣻⣻⣻⣻
Due to the blank braille character being more narrow than the other braille characters, some lines can look like they differ in length. Putting the option will combat this, but the look of the outcome may differ, especially when rotating. But generally, either option can look better depending on the input.
90°:
⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠻⠟⠫⠁⠨⠀⠨⠙⠻⢿⣿⣿⣿⣿⣿⣿
⠀⢻⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⠡⠀⠨⠀⠨⠀⠨⠀⠨⠀⠨⠀⠉⠻⣿⣿⣿⣿
⠨⠀⠻⣿⣿⠿⠻⠋⠡⠀⠨⠀⢈⠀⠨⠀⠨⠀⠨⠀⠨⠀⠨⠀⠨⠀⠘⢿⣿⣿
⠨⠀⠠⠙⠩⠀⠨⠀⢨⣤⣴⡆⠢⠀⠨⠀⣈⣤⣤⣦⠨⠀⠨⠀⠨⠀⠠⠈⢿⣿
⠨⠀⠨⠀⠈⢠⣾⠏⠻⠛⠩⠋⠈⠠⠨⠀⣿⣿⣿⣿⡆⠀⠨⠀⠨⠀⠨⠀⠈⣿
⠨⠀⠨⠀⠨⠀⠨⠀⠨⠀⠨⠀⠨⠀⠀⣘⣿⣿⣿⣿⣷⡰⡦⡀⠨⠀⠨⠀⠀⢸
⠨⠀⠈⢀⡈⢠⣠⡆⢴⣴⣿⣿⣿⣿⠿⡿⠙⣿⣿⣿⣿⣿⡾⠀⠨⠀⠨⠀⠀⢸
⠨⠀⢠⣿⣿⣾⣾⣷⢸⣿⣿⣿⣿⣧⡍⢮⠀⣿⣿⣿⣿⣿⠡⠀⠨⠀⠨⠀⠀⢹
⢠⣶⣼⣿⣿⣿⣿⣿⡿⣿⡿⢁⣿⣿⣆⢸⣤⣿⣿⣿⣿⠍⠍⠀⠨⠀⠨⠀⠀⣸
⣾⣿⣿⣿⣿⣿⣿⣿⣿⢿⢠⣾⣿⣿⣿⢚⣾⣿⣿⣿⡟⠀⠨⠀⠨⠀⠨⠀⠀⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⡜⣿⣿⣿⣿⣿⡿⠨⠀⠨⠀⠨⠀⢰⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡹⣿⣿⠟⠡⠂⠨⠀⠨⠀⠀⢰⣾⣿
⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠛⠡⠀⠨⠀⠨⠀⠈⣠⣴⣿⣿⣿
⠨⠀⠙⢿⣿⣿⣿⣿⣿⣿⠟⣿⣿⣿⣏⣾⣿⢄⠨⠀⠨⠀⣈⣤⣶⣿⣿⣿⣿⣿
⠨⠀⠨⠀⠨⠛⠿⠿⠟⠁⣰⣮⣭⣿⣿⣯⣭⣾⣦⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿
180°:
⠐⠐⠐⠐⣠⣶⣿⣿⣿⣿⣿⣷⣶⡄⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⣀⣤⣶⣿
⠐⠐⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣤⡀⠐⠐⠐⠐⠐⠐⣠⣴⣿⣿⣿⣿⣿
⠐⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣁⠐⠐⠐⣀⠐⠐⠘⢻⣿⣿⣿⣿⣿
⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠷⠄⠐⠐⠻⢷⠐⠐⠐⢿⣿⣿⣿⣿
⠈⠻⣿⣿⣿⣿⣿⣿⣿⣏⣻⣿⣽⣿⣶⣶⣾⡂⠐⠐⠐⣿⣶⠐⠐⠈⣿⣿⣿⣿
⣷⢆⣬⣿⣿⣿⣿⣿⣿⣿⣶⣄⡙⠻⣿⣿⣿⣿⠐⠐⠐⢼⠿⠆⠐⠐⠸⣿⣿⣿
⣿⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⣿⣿⠐⠐⢀⠐⠐⠁⠂⠐⠐⠈⠻⣿
⣿⢿⣯⣝⣿⣿⣿⣿⠿⣛⡛⣟⣋⣁⣩⢜⢼⣿⡄⣀⠐⠐⠐⠐⠐⠐⠐⠐⠰⣿
⣿⣜⡻⠛⠙⣯⣵⣾⣿⣿⣿⣷⣿⣤⣤⣤⣤⣾⣿⣿⣿⣿⣧⠐⠐⠐⠐⠐⠐⠹
⣿⡥⠐⠐⠐⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠄⠐⠐⠐⠐⠐⠐
⣿⣷⠐⠐⠐⠐⠐⠌⢿⣿⠉⠛⠻⢻⣿⣿⣿⣿⢟⡋⠉⠁⠐⠐⠐⠐⠐⠐⠐⣰
⣿⣿⣧⠐⠐⠐⠐⠐⠐⠐⠐⠐⠈⠘⠐⠈⠙⠓⠝⠁⠐⠐⠐⠐⠐⠐⠐⠐⣰⣿
⣿⣿⣿⣧⣄⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⢀⣼⣿⣿
⣿⣿⣿⣿⣿⣦⣀⡀⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⠐⢀⣠⣶⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣷⣶⣦⣤⣤⣄⣀⣀⣠⣀⣀⣀⣀⣤⣴⣾⣿⣿⣿⣿⣿⣿⣿
270°:
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢿⠻⡿⣛⣻⣿⣿⣛⡻⠏⢀⣴⣶⣶⣤⡂⠀⡂⠀⡂
⣿⣿⣿⣿⣿⠿⠛⡉⠀⡂⠀⡂⠑⣿⡿⣹⣿⣿⣿⣴⣿⣿⣿⣿⣿⣿⣷⣄⠀⡂
⣿⣿⣿⠟⠋⡀⠀⡂⠀⡂⠀⢂⣤⢾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄
⣿⡿⠇⠀⠀⡂⠀⡂⠠⢂⣴⣿⣿⣎⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⠇⠀⡂⠀⡂⠀⡂⣾⣿⣿⣿⣿⣿⡜⣿⣿⣿⣿⣿⡿⢿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⠀⠀⡂⠀⡂⠀⡂⠀⣼⣿⣿⣿⡿⡥⣿⣿⣿⡿⠃⣷⣿⣿⣿⣿⣿⣿⣿⣿⡿
⡏⠀⠀⡂⠀⡂⠀⣐⣐⣿⣿⣿⣿⠛⡇⠹⣿⣿⢁⣾⣿⣾⣿⣿⣿⣿⣿⡟⠿⠃
⣇⠀⠀⡂⠀⡂⠀⢂⣿⣿⣿⣿⣿⠀⡳⣘⢻⣿⣿⣿⣿⡇⢿⡿⡿⣿⣿⠃⠀⡂
⡇⠀⠀⡂⠀⡂⠀⡾⣿⣿⣿⣿⣿⣄⣾⣶⣿⣿⣿⣿⠟⠗⠸⠋⠃⡈⠁⡀⠀⡂
⡇⠀⠀⡂⠀⡂⠈⠺⠎⢿⣿⣿⣿⣿⡍⠀⠀⡂⠀⡂⠀⡂⠀⡂⠀⡂⠀⡂⠀⡂
⣿⡀⠀⡂⠀⡂⠀⡂⠀⠸⣿⣿⣿⣿⠀⡂⠂⡀⣠⣂⣤⣦⣰⡿⠃⡀⠀⡂⠀⡂
⣿⣷⡀⠂⠀⡂⠀⡂⠀⡂⠻⠛⠛⡉⠀⡂⠀⠢⠸⠟⠛⡃⠀⡂⠀⣂⣄⠂⠀⡂
⣿⣿⣷⡄⠀⡂⠀⡂⠀⡂⠀⡂⠀⡂⠀⡂⠀⡁⠀⡂⠀⢂⣠⣦⣶⣿⣿⣦⠀⡂
⣿⣿⣿⣿⣦⣀⠀⡂⠀⡂⠀⡂⠀⡂⠀⡂⠀⢂⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀
⣿⣿⣿⣿⣿⣿⣷⣦⣄⡂⠀⡂⢀⣢⣴⣦⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧
For rotating, every line should have an even amount of characters. If not, the last single character of each line will get ignored and will not show up in the end result.
⣿⣿⣿⣿⣿⣿⣿⡿⠿⠟⠛⠛⠋⠉⠉⠙⠉⠉⠉⠉⠛⠻⢿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⠟⠉⠁⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠈⠙⠿⣿⣿⣿⣿
⣿⣿⣿⡟⠋⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠈⢻⣿⣿
⣿⣿⡟⠠⠠⠠⠠⠠⠠⠠⠠⠠⢀⢠⠠⢀⣠⡤⣢⡀⠠⠠⠠⠠⠠⠠⠠⠠⠹⣿
⣿⡿⠠⠠⠠⠠⠠⢂⣾⣿⣀⣤⣴⣼⣿⣿⣿⣿⣮⣅⣀⡀⠠⠠⠠⠠⠠⠠⠠⠹
⣿⡓⠠⠠⠠⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠂⠠⠠⠠⠠⠠⠠
⣿⢫⣵⣤⣠⣟⡻⢿⣿⣿⣿⡿⣿⠛⠛⠛⠛⢿⣿⣿⣿⣿⡟⠠⠠⠠⠠⠠⠠⣰
⣿⣾⣟⣫⣿⣿⣿⣿⣶⣭⣥⣯⣍⡉⣙⢪⢺⣿⠃⠉⠠⠠⠠⠠⠠⠠⠠⠠⠰⣿
⣿⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣿⠠⠠⠈⠠⠠⡀⠄⠠⠠⢀⣴⣿
⡿⠎⢛⣿⣿⣿⣿⣿⣿⣿⠿⠋⣡⣴⣿⣿⣿⣿⠠⠠⠠⢺⣶⠆⠠⠠⢰⣿⣿⣿
⢀⣴⣿⣿⣿⣿⣿⣿⣿⣏⣽⣿⣻⣿⠿⠿⢿⠅⠠⠠⠠⣿⠿⠠⠠⢀⣿⣿⣿⣿
⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⡶⠂⠠⠠⣴⡾⠠⠠⠠⣾⣿⣿⣿⣿
⠠⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⡉⠠⠠⠠⠉⠠⠠⢠⣼⣿⣿⣿⣿⣿
⠠⠠⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠛⠁⠠⠠⠠⠠⠠⠠⠙⠻⣿⣿⣿⣿⣿
⠠⠠⠠⠠⠙⠿⣿⣿⣿⣿⣿⡿⠿⠃⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠠⠉⠛⠿⣿