Python script to convert any file to a PNG image.
The script file_to_png.py aims to create a PNG file that can store any file format (video, image, pdf, archive...). The file data is stored in the hexadecimal values of the pixels of the image.
The script png_to_file.py aims to recover the file from the previously generated PNG file.
file_to_png.py <input_file> <output_image_name>
Don't add any extension to <output_image_name>
<output_image_name> is optional, default is "output"
png_to_file.py <input_png> <output_file>
<output_file> is optional, default is "output.dat"
python file_to_png.py Document.pdf Document
This create a file Document.png from Document.pdf
python png_to_file.py Document.png recovered_Document.pdf
This read the file Document.png and recreate the file recovered_Document.pdf
The new recovered_Document.pdf is the same as recovered_Document.pdf, there may be a few extra bytes \x00 at the end of recovered_Document.pdf but this should not cause any problems.