Convert any image or text into braille. I have used openCV, PIL and braillegraph by Chris bouchard but i have slightly upgraded his library.
This package is hosted on PyPI, so installation should be as simple as
$ pip install imagetobrailleart
Note that this package requires at least Python 3.3, so if your default Python installation is still Python 2, make sure you use pip3.
openCV and pillow are necessary for this library. They will be automatically installed in package. If it is not installed or not working then follow these commands.
$ pip install opencv-python==4.5.3.56
$ pip install pillow==8.3.1
Again, use python3 if necessary.
You can either use imagetobraille
or texttobraille
Import imagetobrailleart to start using it.
imagetobraille("location_of_image", size = 100, inverse = 0)
100 is the minimum size we recommend and to inverse the image use 1 and if you don't want ot inverse it then use 0 or left it blank.
Example to print face of a girl:
>>> import imagetobrailleart as itb
>>> a = itb.imagetobraille("C:\\Users\\yash\\Desktop\\face2.jpg")
>>> print(a)
texttobraille("font_location","text", size = 100, inverse = 0)
To inverse the image use 1 and if you don't want ot inverse it then use 0 or left it blank.
Example to print HEY:
>>> import imagetobrailleart as itb
>>> a = itb.texttoimage("arial.tff","HEY", 100, 0)
>>> print(a)
MIT
Free Code, Hell Yeah!