Binarify is a python package that lets you convert any image to binary.
Let's take a picture of the spidercat.
Let's Binarify it.
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001001000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010000000000101000000000000000000000000000000000000000000000
000000000000000000000000000000101010100000001000000000000000000000000000000000000000000000
000000000000000000000000000000100010000000000101000000000000000000000000000000000000000000
000000000000000000000000000000000001010000001000000000000000000000000000000000000000000000
000000000000000000000000000000110000101000001000000000000000000000000000000000000000000000
000000000000000000000000000000001000000101100010000101000000000000000000000000000000000000
000000000000000000000000000000100100010000001001010010111000000000000000000000000000000000
000000000000000000000000000000000100000000000100000000000110000000000000000000000000000000
000000000000000000000000000000000011011101101001000000000011000000000000000000000000000000
000000000000000000000000000000000000000000000100000000000000100000000000000000000000000000
000000000000000000000000000000000000000000000001010000000000100000000000000000000000000000
000000000000000000000000000000000000000000010100100000000100000000000000000000000000000000
000000000000000000000000000000000000000000100010001000001010100000000000000000000000000000
000000000000000000000000000000000000000010000000100000000100000000000000000000000000000000
000000000000000000000000000000000000000100100010001000001010000000000000000000000000000000
000000000000000000000000000000000000000001000000100100000000100000000000000000000000000000
000000000000000000000000000000000000101000000000000010000000000000000000000000000000000000
000000000000000000000000000000000000000100000000001000100000000000000000000000000000000000
000000000000000000000000000000000001001000000000000010001000000000000000000000000000000000
000000000000000000000000000000000000100010000000001000100000000000000000000000000000000000
000000000000000000000000000000000000010000000000000010000000000000000000000000000000000000
000000000000000000000000000000000000001010000000000100010000000000000000000000000000000000
000000000000000000000000000000000000100000000000000001000000000000000000000000000000000000
000000000000000000000000000000000000010100100000001010000101000000000000000000000000000000
000000000000000000000000000000000000001000000000000000010000000000000000000000000000000000
000000000000000000000000000000000000100101010101010101001010101000000000000000000000000000
000000000000000000000000000000000000001000000000001000000000000000000000000000000000000000
000000000000000000000000000000000000000101001001010010000000101000000000000000000000000000
000000000000000000000000000000000000010000100100000100000000000000000000000000000000000000
000000000000000000000000000000000000000100000001010000000000000100000000000000000000000000
000000000000000000000000000000000001001001010100000101000000000010000000000000000000000000
000000000000000000000000000000000100100010010010101000100100000100100000000000000000000000
000000000000000000000000000000010000010100100100010010010001000000000000000000000000000000
000000000000000000000000000000001010100010001001000100100100000000000000000000000000000000
000000000000000000000000000001010000010001010000101001001001010000000000000000000000000000
000000000000000000000000000000100101001010000101000100010010000000000000000000000000000000
000000000000000000000000000010001001000100101000100010100100101000000000000000000000000000
000000000000000000000000000010100100101001000010010100010001000100000000000000000000000000
000000000000000000000000000100010010000100010001001000100100101000000010000000000000000000
000000000000000000000000000010001000111001001010010111000010000000000000000000000000000000
000000000000000000000000001001010011111100100001001111110100101000000000000000000000000000
000000000000000000000000000100000111110110010100111101111001001010000000000000000000000000
000000000000000000000000000010101111011110000010010111011100010000000000000000000000000000
000000000000000000000000001000001111111011010100011111110101001010000000000000000000000000
000000000000000000000000000101011101101111000010111011011110010000000000000000000000000000
000000000000000000000000000000011111111111001000111111111111000100000000000000000000000000
000000000000000000000000001010111011011000010010000101101011010010000000000000000000000000
000000000000000000000000000100111110000001001001000000011111001000000000000000000000000000
000000000000000000000000000010000001001000100100101010000000000100000000000000000000000000
000000000000000000000000000100100100100101001001000001010001010000000000000000000000000000
000000000000000000000000000001001000010000100010010100001010001000000000000000000000000000
000000000000000000000000000000100010100101001000100010100100100000000000000000000000000000
000000000000000000000000000010001001001000100101001001010001000000000000000000000000000000
000000000000000000000000000000100100010010010000100100001010010000000000000000000000000000
000000000000000000000000000000010010100100100101001001010001000000000000000000000000000000
000000000000000000000000000000000100010001001000100100100100100000000000000000000000000000
000000000000000000000000000001010010001010010010010010000010010000000000000000000000000000
000000000000000000000000000000010001010001000100100001010100000000000000000000000000000000
000000000000000000000000000001001010000000101001000000000010100000000000000000000000000000
000000000000000000000000000000100100000000000000000000010100100000000000000000000000000000
000000000000000000000000000000010000000000000000000000000010010000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000001111111111111111111111111111111000000000000000000000000000000
000000000000000000000000001111111111111111111111111111111111111100000000000000000000000000
000000000000000000000000000111011010110110110110110110110110111000000000000000000000000000
000000000000000000000000000000000111111111111111111111110000000000000000000000000000000000
Contents
What is Binarify
Binarify is a python script that lets you convert any image to a binary image resembling the input image.
In other words, it replicates an image with 1's and 0's.
Setup
Make sure you have the following packages installed before usage:
- Pillows >= 3.4.0
- urllib
- argparse
Use Binarify
- Clone this repository.
- Typical usage often looks like :
python binarify.py -input path/to/image.jpg -output path/to/output/text/file -mode black -width 120
- Check the output.txt file for the text version of the same.
Support Me
If you ❤️ it, ⭐ this repo.
Help me translate this README into other languages. 😄
Check out my other work too either on Github or on my website.
Enjoy!