This repository contains a Python script that allows you to encode any kind of file or data into a series of black and white images representing the file's bits. It also provides functionality to decode these images back into the original data.
The Pixelizer provides a way to transform the binary data of a file by converting the bits into black and white pixels. The resulting sequence of images can then be converted into a video file.
Furthermore, the script also allows you to decode a video file back into the original data, reconstructing the bits from the black and white images.
- Clone this repository to your local machine:
$ git clone https://github.com/hasssanezzz/pixelizer
- Navigate into the cloned directory:
$ cd pixelizer
- Install the required dependencies. You can use pip to install them automatically:
$ pip install -r requirements.txt
To encode a file, provide the input file path and the desired output file path. The script will convert the file's bits into a series of black and white images and save them as a video file.
python3 pixelizer.py -i '<your_file>' -o '<generated_mp4>'
Example:
python3 pixelizer.py -i data.txt -o output_video.mp4
To decode a video file, provide the -d
flag, the path of the video file, and the desired output file path. The script will extract the black and white images from the video and decode them back into the original data.
python3 pixelizer.py -d -i '<mp4_file_path>' -o '<decoded_file>'
Example:
python3 pixelizer.py -i video.mp4 -o data.txt
Contributions are welcome! If you'd like to contribute to the project, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b my-feature
. - Make your changes and commit them:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin my-feature
. - Submit a pull request.