This is a fun little project that encodes any file into a png image
The way it works is by taking the binary data of the files and converting each hexadecimel character into a pixel. We can therefore store 1920 x 1080 x 4 = 8 294 400 bits of data in a single image.
To encode a file, run the following command:
python main.py encode <input_file> <output_file>.png
To decode a file, run the following command:
python main.py decode <input_file>.png <output_file>
Taking the file bee-movie-script.md
as an example, we can encode it into a png image:
python main.py encode bee-movie-script.md bee-movie-script.png
We get the following image:
We can then decode the image back into the original file:
python main.py decode bee-movie.png bee-movie-script.md
I want to make this more useful by converting the output from images to videos, the objective is that they can actually withstand compression and be uploaded to YouTube.
This project was inspired by the following videos