How to Convert Text to Image and Image to Text using Python.
Video Link:-
In this tutorial we will learn how to convert text to image using NumPy Arrays.
You can encode your secret text code to image and transfer it to any device without any security breach then at receiving point decode the image to original text. Accuracy is 100%.
Basic Concept of this Application is as follows:-
1. Convert Text to List of ASCII Codes.
2. Convert List to 1 Dimensional NumPy Array.
3. Resize 1D to 2D Matrix using NumPy Resize Function.
4. Convert Matrix to Binary Data using PIL Library.
5. Save Binary data as a PNG Image.
6. Show Image using OpenCV.
Then for converting image to text, perform same actions in revers orders.
Main Libraries I used here are:-
- PIL
- Pillow
- NumPy
- Time
- OpenCV
My Environment is Anaconda.
I used Anaconda Command prompt for the installation of package libraries.
I used PIP and CONDA manager in Virtual Environment for the libraries installation.
*For OpenCV installation, write:-
>>conda install -c anaconda opencv
*For PIL installation, write:-
>>pip install pillow
Subscribe our YouTube Channel for more information:-