Skip to content

Commit

Permalink
Updated the install with pip usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ESultanik committed Aug 25, 2020
1 parent eade018 commit d7fa0ac
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
bin2png
=======

A simple cross-platform script for encoding any binary file into a lossless PNG. Each pixel of the output image encodes three bytes of the input file: The first byte is encoded in the red channel, the second byte in the green channel, and the third byte in the blue channel. All files will be tail-padded with zeros so that they have a byte count that is a multiple of three. The dimensions of the output image are automatically calculated such that they are as close to a multiple of three as possible. If there are multiple dimensions that require minimal padding, the one that is closest to square is chosen. The width and height of the output image can also be optionally overridden.
A simple cross-platform script for encoding any binary file into a lossless PNG.
Each pixel of the output image encodes three bytes of the input file: The first byte is encoded in the red channel,
the second byte in the green channel, and the third byte in the blue channel. All files will be tail-padded with zeros
so that they have a byte count that is a multiple of three. The dimensions of the output image are automatically
calculated such that they are as close to a multiple of three as possible. If there are multiple dimensions that
require minimal padding, the one that is closest to square is chosen. The width and height of the output image can
also be optionally overridden.

bin2png is backward compatible with both Python 2 and Python 3.

On Windows, this is another solution: https://github.com/leeroybrun/Bin2PNG

## Usage

```shell
$ python3 bin2png.py file_to_encode -o output.png
$ pip install bin2png

$ bin2png file_to_encode -o output.png

$ python3 bin2png.py -d output.png | diff - file_to_encode -s
$ bin2png -d output.png | diff - file_to_encode -s
Files - and file_to_encode are identical
```

Expand Down

0 comments on commit d7fa0ac

Please sign in to comment.