Image-to-code is a python based OCR tool specifically made to capture an image with a code-snippet, and instantly get in in text form onto a text editor for the user.
It uses the pytesseract wrapper for the tesseract-OCR and pyGtk for GUI.
Simply run the gui1.py file using the terminal.
$ python gui1.py
This will open up a simple text editor.
Then, follow these steps:
- Click the choose file button, and choose an image file with the code-snippet in it
- Click the scan button
- The code from the image comes into the text editor (the language of the code is identified and is highlighted accordingly)
(You may have to edit the scanned code as the OCR is not perfect, and can result in abnormal scans)
- Add support for other popular languages
- Drag and drop images
- Train the OCR for better results
- Enhance the text editor
Image-to-code uses a number of open source projects to work properly:
- Tesseract-OCR - OCR library
- Pytesseract - python wrapper for Tesseract
- PyGTK - GTK for python
- Pygments - Syntax highlighter
- Pillow - Python imaging library
Others:
- Jitesh Pabla
- Sajal Subodh
- Shivan Trivedi