Here is a minimal image image to text converter using python imaging library, PIL. The program receives its input a binary BITMAP(.bmp) image, (i.e it has only pixel values (0,0,0) and (255,255,255) . Jpeg files do not produce a perfect output, may be because of the encoding used. The converter program scans the whole image and creates a set of values which are written to a text file “text”. The equivalent text can be seen in the output file.
An example of a text generated from a bitmap image is shown below:-
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000111111111100000
00000111111111100000
00000111111111100000
00000111111111100000
00000111111111100000
00000111111111100000
00000111111111100000
00000111111111100000
00000111111111100000
00000111111111100000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
The source code of the program is :-

