Giter Site home page Giter Site logo

visto's Introduction

visto

Travis GitHub license

visto (Visual Storage) allows you to store Bytes as an image.

Build

> crystal build src/cli.cr --release -o visto

Usage

Command Line

> 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

Library

Add this to your application's shard.yml:

dependencies:
  visto:
    github: petoem/visto

Visto.encode(data : Bytes) : Canvas

Returns a StumpyCore::Canvas that contains data.

Visto.decode(canvas : Canvas) : Bytes

Returns the extracted bytes from the canvas.

Example

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.

Contributing

  1. Fork it ( https://github.com/petoem/visto/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • petoem Michael Petö - creator, maintainer

visto's People

Contributors

petoem avatar

Stargazers

Sijawusz Pur Rahnama avatar Pedro M. Silva avatar Gabriel Aires Guedes avatar Stephan Langeveld avatar

Watchers

James Cloos avatar  avatar Gabriel Aires Guedes avatar Ed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.