Skip to content

MiniGlome/File-to-Image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

File-to-Image

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.

How to use

  • 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"

Example

  • 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.

About

Python script to convert any file to a PNG image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages