visto (Visual Storage) allows you to store Bytes
as an image.
> crystal build src/cli.cr --release -o visto
> visto --help
Usage: visto [FILE] [arguments]
-e, --encode Encode data into image
-d, --decode Decode data from image
-o FILE, --output=FILE Specifies the output file path
-v, --version Show version number
-h, --help Show this help
>
> # to store a file as an image, run ...
> visto myawesome.pdf -e -o image.png
> # to get your file ...
> visto image.png -d -o my.pdf
Add this to your application's shard.yml
:
dependencies:
visto:
github: petoem/visto
Returns a StumpyCore::Canvas that contains data.
Returns the extracted bytes from the canvas.
The file random.txt as an image.
Each pixel corresponds to a byte. Bytes are written from left to right, top to bottom.
The first 8 pixels represents a UInt64
number, which tells how many bytes long the stored data is.
After this data pixels follow. Any excess pixels at the end are filled up with black.
- Fork it ( https://github.com/petoem/visto/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- petoem Michael Petö - creator, maintainer